cpp/regex/regex traits/transform primary

For the character sequence, obtains the primary sort key in the imbued locale's collating order, that is, the sort key that is based on the positions of the letters and collation units in the national alphabet, ignoring case, diacritics, variants, etc. If a primary sort key compares less than another primary sort key with , then the character sequence that produced the first sort key comes before the character sequence that produced the second sort key, in the currently imbued locale's primary collation order.

The regex library uses this trait to match characters against equivalence classes. For example, the regex is equivalent to the character  if  is equivalent to  (which is true for any  from  in the U.S. English locale). Note that takes a character sequence argument because equivalence classes may be multicharacter, such as  in Czech or  in Hungarian. There is no portable way to define primary sort key in terms of std since the conversion from the collation key returned by to the primary equivalence key is locale-specific, and if the user replaces the std facet, that conversion is no longer known to the standard library's std. Standard library specializations of std return an empty string unless the std facet of the currently-imbued locale was not replaced by the user, and still matches the system-supplied std facet), in which case is executed and the sort key it produces is converted to the expected primary sort key using a locale-specific conversion.

Return value
The primary sort key for the character sequence in the currently imbued locale, ignoring case, variant, diacritics, etc.