On 2014-08-19 16:01, Adam Wulkiewicz wrote:
Roland Bock wrote:
On 2014-08-19 14:03, Adam Wulkiewicz wrote:
But I think optionals wouldn't be safe. Correct me if I'm wrong. If optionals were used without a check for validity and the unexpected NULL value was set in the DB (maybe by mistake), it could result in segmentation fault. Of course assuming that the macro BOOST_ASSERT() wouldn't be expanded to some exception throw. This could lead to some security vulnerabilities in apps using this library. I thought the whole purpose of the optional-interface was to make people to check for validity first?
If I understand you correctly, you should be more happy with the current implementation
Yes, exceptions and default values seems to be better to handle the NULL/unexpected values.
I started the discussion because you wrote in the Wiki that the problem with optionals is related to the binding of values which IMO is just an implementation detail. Maybe it would be a good idea to explicitly state why do you think that optionals shouldn't be used. Define a rationale behind it. Thanks for the discussion, its been quite helpful :-)
Cheers, Roland