regex_traits::transform_primary
mistakenly detects typeid
of a functionSection: 28.6.6 [re.traits] Status: Voting Submitter: Jiang An Opened: 2024-12-18 Last modified: 2025-02-07
Priority: Not Prioritized
View other active issues in [re.traits].
View all other issues in [re.traits].
View all issues with Voting status.
Discussion:
28.6.6 [re.traits]/7 currently says typeid(use_facet<collate<charT>>) ==
typeid(collate_byname<charT>)
, which is always false
because
use_facet<collate<charT>>
is a function template specialization while
collate_byname<charT>
is a class template specialization. This looks like
misuse, and has been present in TR1 (N1836).
use_facet<collate<charT>>(getloc())
.
[2025-02-07; Reflector poll]
Set status to Tentatively Ready after seven votes in favour during reflector poll.
Proposed resolution:
This wording is relative to N5001.
Modify 28.6.6 [re.traits] as indicated:
template<class ForwardIterator> string_type transform_primary(ForwardIterator first, ForwardIterator last) const;-7- Effects: If
typeid(use_facet<collate<charT>>(getloc())) == typeid(collate_byname<charT>)and the form of the sort key returned by
collate_byname<charT>::transform(first, last)
is known and can be converted into a primary sort key then returns that key, otherwise returns an empty string.