-
Notifications
You must be signed in to change notification settings - Fork 161
Support explicit insertion of boost::none #48
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
Comments
Sounds interessting, never thought about that way to do it. db << "INSERT INTO foo(field) VALUES (?)" << sqlite3::null; This would be a nice thing to have. |
Sure, that works just as well. |
I added that as a extension because it has limited use to the normal user and does not require changes to the main header to work. First i tried to make the null_value more intelligent and able to store the data is the value was not null but that would duplicate the functionality boost::optional already has and we have support for that already. Thats why this is such a simplistic approach. @aminroosta if you are happy with this too, plz pull. |
Thats elegant and gets rid of boost::optional in one go, i like it. |
Cool, i will update readme in #52 and then merge. |
Hm, I agree that this solution is quite elegant, but deprecating |
Is |
So we deprecate boost but let it in till then, but its non the less deprecated. |
|
If |
I dont see why we should depricate the unique_ptr stuff its a valid alternative to the optional stuff. And i would prefer it over the other. But we might add to the deprecation text of boost::optional that it will be replaced by std::optional when its available. |
According to std::optional reference. Any instance of |
Thats what @bjoernpollex said. And he has a valid point in that its usefull and should be in there. But i dont fear a simple new ;). On the other hand thats true for unique_ptr, too if you think about it. The space for the pointer is allocated at instanciation and might never contain anything other then the nullptr ;) |
I'm happy with the way we are handling null values right now. :-) |
I agree, right now both ways work and are useful for different scenarios. |
It would be useful to support explicitly inserting NULL values by writing
boost::none
, like this:Currently this does not work because
boost::none
is a special type, and not automatically converted to any of the overloads forboost::optional
.The text was updated successfully, but these errors were encountered: