Hi Roland, Roland Bock wrote:
_NULL handling:_ Enabled by the restructured code and spurred by the library quince by Michael Shepanski, sqlpp11 can now calculate which result fields can or cannot be NULL.
Speaking of which, handling NULL for result values has been discussed a lot. The library now has compile-time configurable behavior, you can choose between an std::optional-like interface and mapping NULL to the trivial value of the result type, e.g. 0 for numbers or "" for strings, see also https://github.com/rbock/sqlpp11/wiki/NULL
You wrote in the docs: <cite> One often discussed alternative would be boost::optional or (in the future) std::optional. There is one drawbacks (correct me if I am wrong, please):| optional| cannot be used for binding result values because it is unclear whether there already is a value to bind to. </cite> What do you mean by that? If I understand correctly, you have in mind returning boost::optional<> from a function. It's ok to do it, the value is stored in optional and deep copies are done if needed. http://www.boost.org/doc/libs/1_56_0/libs/optional/doc/html/boost_optional/t... http://www.boost.org/doc/libs/1_56_0/libs/optional/doc/html/boost_optional/q... Regards, Adam