Skip to content

Commit

Permalink
ICU-22920 Avoid CTAD in Formattable's constructor. NFC
Browse files Browse the repository at this point in the history
This line uses CTAD on `pair`, when every other place in the codebase
uses a function call to `make_pair` (and no other place uses CTAD on
any class template at all). Assume this was unintentional, and fix it.

    warning: class template argument deduction is incompatible with
    C++ standards before C++17; for compatibility, use explicit type
    name 'std::pair<const Formattable *, int>'
    (aka 'pair<const icu_77::message2::Formattable *, int>') [-Wctad]
          Formattable(const Formattable* arr, int32_t len) : contents(std::pair(arr, len)) {}
                                                                      ^~~~~~~~~
  • Loading branch information
Quuxplusone committed Jan 24, 2025
1 parent ba4d4d3 commit b9ccc39
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion icu4c/source/i18n/unicode/messageformat2_formattable.h
Original file line number Diff line number Diff line change
Expand Up @@ -389,7 +389,7 @@ namespace message2 {
* @internal ICU 75 technology preview
* @deprecated This API is for technology preview only.
*/
Formattable(const Formattable* arr, int32_t len) : contents(std::pair(arr, len)) {}
Formattable(const Formattable* arr, int32_t len) : contents(std::make_pair(arr, len)) {}
/**
* Object constructor.
*
Expand Down

0 comments on commit b9ccc39

Please sign in to comment.