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

numeric_limits::max compilation problem on windows

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Critical - P2 Critical - P2
    • legacy-0.8.0
    • Affects Version/s: None
    • Component/s: None
    • Environment:
      Windows with MSVC 2008

      Compilation of client applications may break because of the in-header implementation of many methods, e.g. in bsonutils. There numeric_limits::max is used, which gives a compilation error because max is often defined as a macro which may be pulled in earlier by other headers. Even WinDef.h defines this macro. Please ensure that the mongodb code undefs any existing version of max before using numeric_limits::max. This error would be much easier to prevent if the methods weren't implemented in-header.

            Assignee:
            andrew.morrow@mongodb.com Andrew Morrow (Inactive)
            Reporter:
            languitar Johannes Wienke
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: