Uploaded image for project: 'C++ Driver'
  1. C++ Driver
  2. CXX-506

Use MNMLSTC for polyfills

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 0.1.0
    • Component/s: Portability
    • Labels:
      None
    • Sprint:
      Platform 00 2/20/15

      Description

      • 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

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: