-
Type: Improvement
-
Resolution: Done
-
Priority: Major - P3
-
Affects Version/s: None
-
Component/s: Portability
-
None
- In C++11, you must use MNMLSTC.
- In C++14, you can choose to use MNMLSTC or not.
In both cases, you can choose to either use the system version of the library, or ours. For ours, we will obtain it with ExternalProjectAdd.
Note that when using the embedded version of MNMLSTC, we will need to install the MNMLSTC headers to somewhere within our installed include directory, so as to not conflict with a potential system copy.
This will require that we have a config.h header variable like LIBMONGOCXX_USING_PRIVATE_MNMLSTC, and then each polyfill header will need to look like:
#include <mongocxx/driver/config.h> #if defined(LIBMONGOCXX_USING_MNMLSTC) #if defined(LIBMONGOCXX_USING_PRIVATE_MNMLSTC) #include <mongocxx/mnmlstc/foo.h> #else #include <core/foo.h> #endif namespace mongo { namespace stdx { using foo = ::mnmlstc::foo; } // namespace stdx } // namespace mongo #elif __cplusplus >= 201402L #include <foo> namespace mongo { namespace stdx { using foo = ::std::foo; } // namespace stdx } // namespace mongo #else #error Cannot find a polyfill for "foo" #endif