Skip to content
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

Sql fails with iteration on list of records #71

Open
lythesia opened this issue Jun 14, 2019 · 3 comments
Open

Sql fails with iteration on list of records #71

lythesia opened this issue Jun 14, 2019 · 3 comments

Comments

@lythesia
Copy link

c("select id from users")() | [] (int &uid) { std::cout << uid << std::endl; };
fails with

usr/include/silicon/middlewares/sqlite_connection.hh:115:9: error: no matching member function for call to 'row_to_sio'
        row_to_sio(o);
        ^~~~~~~~~~
test.cc:36:39: note: in instantiation of function template specialization 'sl::sqlite_statement::operator|<(lambda at test.cc:36:41)>' requested here
  c("select id from users")() | [] (int &uid)
                                      ^
/usr/include/silicon/middlewares/sqlite_connection.hh:37:10: note: candidate template ignored: could not match 'sio<type-parameter-0-0...>' against 'int'
    void row_to_sio(iod::sio<A...>& o)

seems like only sio objects work with |?

@matt-42
Copy link
Owner

matt-42 commented Jun 16, 2019

Which compiler do you use ? This should works. See this test here: https://github.com/matt-42/silicon/blob/master/tests/mysql.cc#L96

@lythesia
Copy link
Author

clang version 8.0.0 (tags/RELEASE_800/final)
Target: x86_64-pc-linux-gnu
Thread model: posix
InstalledDir: /usr/bin

@lythesia
Copy link
Author

mysql_connection works as expected, but sqlite_connection fails

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants