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

max_time->count(), seconds.count() ambiguous

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 3.0.2
    • Affects Version/s: 3.0.0
    • Component/s: Implementation

      When compiling on CentOS with clang 3.7.1, using the modern c++ library, i.e., using CXXFLAGS="std=c+11 -stdlib=libc+", use of options.max_time()>count() in collection.cpp and seconds.count() in modify_collection.cpp are found to be ambiguous by the compiler.

      In the first case of the 4 uses of options.max_time()->count() in collection.cpp, count() is a signed integral of at least 45 bits. In the case of the single seconds.count() in modify_collection.cpp, count() is a signed integral of at least 35 bits.

      Thus, it would seem that wrapping these in bsoncxx:types:b_int64 is the right thing to do, and it does in our case prevent the compiler from erroring out on the ambiguity, but we're just trying the non-legacy library for the first time, and thus aren't sure if this is an ideal approach.

            Assignee:
            david.golden@mongodb.com David Golden
            Reporter:
            alb@neptunesystems.com Allan Bazinet
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: