-
-
Notifications
You must be signed in to change notification settings - Fork 321
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cannot convert condition to tuple in mapped_view
#1346
Labels
Comments
stevenwdv
added a commit
to stevenwdv/sqlite_orm
that referenced
this issue
Sep 3, 2024
stevenwdv
added a commit
to stevenwdv/sqlite_orm
that referenced
this issue
Sep 3, 2024
@stevenwdv could you please show the least code which can repro this issue? It will help a lot in creating a unit test which covers this issue to avoid it firing in future again |
Hi! Apparently the issue occurs when using #include <iostream>
#include <string>
#include <sqlite_orm.h> // v1.9
struct Person {
std::string name;
bool dead{};
};
void listPeople(const std::string &path) {
using namespace sqlite_orm;
auto storage = make_storage(path,
make_table("People",
make_column("name", &Person::name)
)
);
for (const auto &person : storage.iterate<Person>(
where(c(&Person::dead) == false),
order_by(&Person::name).asc()
)) {
std::cout << person.name << '\n';
}
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This is a regression since v1.9.
When using
iterate
(or more generally,mapped_view
) withwhere()
(or more generally, a condition), I get an error:This is caused by the constructor of
mapped_view
constructingexpression
asexpression{std::forward<Args>(args)...}
, while it should beexpression{{std::forward<Args>(args)...}}
(construct a struct with atuple
inside).I can reproduce this with clang 20.0.0, clang 14.0.0, Apple clang 15.0.0, MSVC 19.39.33523, all with C++20.
The text was updated successfully, but these errors were encountered: