Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-87013

convert TrackedStringMap<MeasurementCountAndBuilder> to use std::tuple rather than std::pair

    • Type: Icon: Improvement Improvement
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 8.0.0-rc0
    • Affects Version/s: None
    • Component/s: None
    • Labels:
      None
    • Storage Execution
    • Fully Compatible
    • Execution Team 2024-03-04

      The current definition of TrackedStringMap<MeasurementCountAndBuilder> fails compilation under XCode 15 (clang-15) with the following error. Using std::tuple instead of std::pair (see special treatment of std::pair in std::uses_allocator) would avoid this compilation error and would be more idiomatic.

       
      In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.2.sdk/usr/include/c++/v1/memory:903:
      /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.2.sdk/usr/include/c++/v1/__memory/uses_allocator_construction.h:65:20: error: no matching function for call to '__uses_allocator_constr
      uction_args'
                  return std::__uses_allocator_construction_args<typename _Pair::second_type>(
                         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.2.sdk/usr/include/c++/v1/__functional/invoke.h:391:28: note: in instantiation of function template specialization 'std::__uses_allocator_construction_args(const std::scoped_allocator_adaptor<mongo::timeseries::TrackingAllocator<std::pair<const std::string, std::pair<unsigned long, mongo::BSONColumnBuilder>>>> &, piecewise_construct_t, std::tuple<std::string &&> &&, std::tuple<std::pair<unsigned long, mongo::BSONColumnBuilder> &&> &&)::(anonymous class)::operator()<std::pair<unsigned long, mongo::BSONColumnBuilder>>' requested here
      _LIBCPP_CONSTEXPR decltype(std::declval<_Fp>()(std::declval<_Args>()...))
      

            Assignee:
            benety.goh@mongodb.com Benety Goh
            Reporter:
            benety.goh@mongodb.com Benety Goh
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: