-
-
Save Superlokkus/7fc1545f33d10d2caae8 to your computer and use it in GitHub Desktop.
odb boost::optional query::in_range bug
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <vector> | |
#include <odb/core.hxx> | |
#include "object-odb.hxx" | |
int main(int argc, char* argv[]) | |
{ | |
odb::query<object> query; | |
std::vector<decltype(object::is_ok)> values{ true, false, boost::none }; | |
odb::query<object>::is_ok.in_range(values.cbegin(), values.cend()); | |
//^ error C2665: 'odb::mssql::val_bind<T>::val_bind' : none of the 2 overloads could convert all the argument types "q.append<T, ID> (val_bind<T> (*i, prec_, scale_), conversion_);" | |
return 0; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#ifndef OBJECT_H | |
#define OBJECT_H | |
#include <boost/optional.hpp> | |
#include <odb/core.hxx> | |
#include <odb/nullable.hxx> | |
#pragma db object | |
struct object | |
{ | |
#pragma db id auto | |
long id; | |
boost::optional<bool> is_ok; | |
}; | |
#endif |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment