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

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

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: 3.0.0
    • Fix Version/s: 3.0.2
    • Component/s: Implementation
    • Labels:
    • Sprint:
      Platforms 13 (04/22/16), Perl and CXX Team (2016-06-17)

      Description

      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.

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                Created:
                Updated:
                Resolved: