SOCI / soci

Official repository of the SOCI - The C++ Database Access Library
http://soci.sourceforge.net/
Boost Software License 1.0
1.41k stars 477 forks source link

Support for std::optional #999

Closed mkaes closed 1 year ago

mkaes commented 2 years ago

Soci already provides header to support boost::optional types. As c++17 is becoming more and more used it would be nice if soci would also support std::optional

It is not difficult to write and own type_conversion for std::optional but direct support by a header e.g. #include <soci/std-optional.h

vadz commented 1 year ago

Sure, this would be nice to have. I'm not using C++17 with SOCI myself yet, so I don't have any immediate plans to do it, but any PRs would be welcome.

mkaes commented 1 year ago

I opened a pull request #1001 But it lacks check to only enable use of std::optional if c++17 or above is used. I am not quite sure how to do this in cmake and I could only test it for sqlite.

Tectu commented 1 year ago

PR was merged so I guess this issue could be closed :)

vadz commented 1 year ago

Indeed, thanks.