Skip to content

Instantly share code, notes, and snippets.

@Superlokkus
Created November 13, 2015 10:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Superlokkus/7fc1545f33d10d2caae8 to your computer and use it in GitHub Desktop.
Save Superlokkus/7fc1545f33d10d2caae8 to your computer and use it in GitHub Desktop.
odb boost::optional query::in_range bug
#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;
}
#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