SOCI / soci

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

Include std::optional support automatically #1023

Closed Tectu closed 1 year ago

Tectu commented 1 year ago

This change automatically includes the soci/std-optional.h header file if the C++ standard is at least 17.

std::optional is more or less a "core feature" as of C++17 which in my opinion justifies auto-including this header. After all, similarly boost infrastructure is also included automatically (if present/enabled).

Tectu commented 1 year ago

Any news on this?

vadz commented 1 year ago

I'm still not sure if it's really a good idea to do it by default, to be honest, but you're right that doing it for Boost optional but not the standard version is even stranger... And as we can't stop doing it for Boost without breaking the existing code relying on it, we should probably do it for the latter too. And we could always provide some SOCI_NO_OPTIONAL to avoid including this header by default, I guess.

Anyhow, merged now, sorry for the delay.