Commit 45b10848 authored by EXT Arnaud Clère's avatar EXT Arnaud Clère

Removed optional returned type

parent 7c69ab52
......@@ -996,7 +996,7 @@ void doGuiExample() {
.record()
.bind("first name", p.firstName)
.sequence("phones").forEach(p.phones,
[](Phone& phone, Val<Cursor>&& item){
[](Phone& phone, Val<Cursor>&& item) {
return item.bind(phone._n);
},
Phone::isOffice)
......@@ -1004,12 +1004,12 @@ void doGuiExample() {
});
#else
// More expressive design similar to Python list comprehensions that does not work by default for Read/Write
QModelWriter<>(&customModel).sequence().bind(persons, +[](QList<Person>& t, Seq<Cursor>&& s)->Seq<Cursor> { // See https://stackoverflow.com/questions/18889028/a-positive-lambda-what-sorcery-is-this
QModelWriter<>(&customModel).sequence().bind(persons, +[](QList<Person>& t, Seq<Cursor>&& s) { // See https://stackoverflow.com/questions/18889028/a-positive-lambda-what-sorcery-is-this
for (auto&& person : t) { // Read would require looping while !s.item()
s = s // To keep working with the active Cursor
.record()
.bind("first name" , person.firstName)
.bind("office phone", person.phones , +[](QVector<Phone>& t, Val<Cursor>&& v)->Cursor {
.bind("office phone", person.phones, +[](QVector<Phone>& t, Val<Cursor>&& v) {
for (auto&& phone : t) {
if (phone._t == Phone::Office) {
return v.bind(phone._n);
......
Markdown is supported
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