Commit 462cd303 authored by EXT Arnaud Clère's avatar EXT Arnaud Clère
Browse files

Fixed build prb with QBind<_,Val<_>> (added move, maybe add && instead)

parent 079bfb77
......@@ -95,7 +95,7 @@ struct QBind { static TResult bind(Val<TResult> value, T t) {
}};
// NB: QBind has a structure similar to a Traversable : https://wiki.haskell.org/Typeclassopedia#Traversable
// A QTraverse<Val<TResult>>,T> would be equivalent but would not mandate to actually traverse T to get from Val<TResult> to the actual TResult
// A QTraverse<Val<TResult>,T> would be equivalent but would not mandate to actually traverse T to get from Val<TResult> to the actual TResult
// A QFold<TResult,T> would be equivalent to a Foldable allowing to fold T to any TResult without mandating a common Val/Seq structure
template<class TResult, typename T>
......@@ -386,7 +386,7 @@ struct QBind<TSrcResult, Val<TDst>&&, IsReader<TSrcResult>> { static TSrcResult
Val<TSrcResult> srcVal; Val<TDst> dstVal;
while (srcVal = srcSeq._unsafeItem(0)) { // using item()'s Val<Seq<TSrcResult> would cause an infinite compiler loop to generate corresponding QBind<Val<Seq<Seq<...>>,_> functions
dstVal = dstSeq._unsafeItem();
srcSeq = srcVal.bind(dstVal);
srcSeq = srcVal.bind(std::move(dstVal));
}
/**/ dstSeq.out();
......
......@@ -305,11 +305,11 @@ int main()
QVector<QJsonReaderImpl::Error> jsonReaderErrors ;
QVector<JsonVisitorImpl::Error> jsonVisitorErrors;
// START {
// json.seek(0); b.seek(0); b.buffer().clear();
// jsonReaderErrors = QJsonReader(&json).bind(CborWriter(&b).value())->errors;
// }
// STOP("Json>Cbor",QString::fromUtf8(b.buffer().toHex()))
START {
json.seek(0); b.seek(0); b.buffer().clear();
jsonReaderErrors = QJsonReader(&json).bind(CborWriter(&b).value())->errors;
}
STOP("Json>Cbor",QString::fromUtf8(b.buffer().toHex()))
START {
json.seek(0); v = QJsonValue();
jsonReaderErrors = QJsonReader(&json).bind(v)->errors;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment