Error compiling on MSVC with C++17 as target

XMLWordPrintableJSON

    • Type: Task
    • Resolution: Fixed
    • Priority: Minor - P4
    • 3.5.0
    • Affects Version/s: None
    • Component/s: BSON, Documentation
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      On mongo-cxx-driver/src/bsoncxx/stdx/make_unique.hpp, when building with MSVC targeted for C++17, we have an error, because of MSVC problem with __cplusplus variable . Because of that, we get the error "Cannot find a valid polyfill for make_unique".

      To fix this, we can either:

      • Use #elif defined(BSONCXX_POLY_USE_STD) instead of the current #elif __cplusplus >= 201402L
      • On CmakeLists.txt add the "/Zc:__cplusplus" to the target_compile_options if the compiler is MSVC and C++17 is ON as a polyfill.

            Assignee:
            Kevin Albertson
            Reporter:
            Miguel Cunha
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: