Driver fails to compile on MSVC 2017 with C++17 and no polyfill

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Duplicate
    • Priority: Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • None
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      Following the instructions on http://mongocxx.org/mongocxx-v3/installation/

      And using the provided command:

      'C:\Program Files (x86)\CMake\bin\cmake.exe' -G "Visual Studio 15 2017 Win64"
          -DCMAKE_INSTALL_PREFIX=C:\mongo-cxx-driver
          -DCMAKE_PREFIX_PATH=C:\mongo-c-driver
          -DCMAKE_CXX_STANDARD=17
          -DCMAKE_CXX_FLAGS="/Zc:__cplusplus" ..
      

      r3.4.0 fails to compile with the following issues:

      mongo-cxx-driver-r3.4.0\src\mongocxx\options\private\transaction.hh(64): error C2440: 'return': cannot convert from 'initializer list' to 'std::optional<mongocxx::v_noabi::read_concern>' [mongo-cxx-driver-r3.4.0\build_win\src\mongocxx\mongocxx.vcxproj]
      
      mongo-cxx-driver-r3.4.0\src\mongocxx\options\private\transaction.hh(77): error C2440: 'return': cannot convert from 'initializer list' to 'std::optional<mongocxx::v_noabi::write_concern>' [mongo-cxx-driver-r3.4.0\build_win\src\mongocxx\mongocxx.vcxproj]
      
      mongo-cxx-driver-r3.4.0\src\mongocxx\options\private\transaction.hh(90): error C2440: 'return': cannot convert from 'initializer list' to 'std::optional<mongocxx::v_noabi::read_preference>' [mongo-cxx-driver-r3.4.0\build_win\src\mongocxx\mongocxx.vcxproj]
      

      FWIW I am compiling with the strictest warning level etc. etc.

              Assignee:
              Unassigned
              Reporter:
              Sacha Best
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Created:
                Updated:
                Resolved: