[odb-users] boost::optional query::in_range compile error

Boris Kolpackov boris at codesynthesis.com
Mon Nov 16 08:02:01 EST 2015


Hi Markus,

Markus Klemm <markus at markusklemm.net> writes:

> boost::optional<bool> is_ok;
>
> std::vector<decltype(object::is_ok)> values; 
> odb::query<object>::is_ok.in_range(values.cbegin(), values.cend());

For query purposes, ODB "strips" the wrapper (boost::optional in this
case). So std::vector<bool> is what will work. This is actually what
you most likely want anyway since SQL 'IN' is not going to do anything
sensible if you pass it a NULL value.

Boris



More information about the odb-users mailing list