Movatterモバイル変換


[0]ホーム

URL:


cppreference.com
Namespaces
Variants
    Actions

      C++ named requirements:RegexTraits(since C++11)

      From cppreference.com
      <cpp‎ |named req
       
       
      C++ named requirements
       

      RegexTraits is a traits class that abstracts operations needed for a given character type when as template type parameters forstd::basic_regex.

      [edit]Requirements

      Given

      • CharT, a character type
      • X, aRegexTraits type for typeCharT
      • u, an object of typeX
      • v, an object of typeconst X
      • p, a value of typeconst CharT*
      • I1, I2, input iterators
      • F1, F2, forward iterators
      • c, a value of typeconst CharT
      • s, an object of typeX::string_type
      • cs, an object of typeconst X::string_type
      • b, a value of typebool
      • I, a value of typeint
      • cl, an object of typeX::char_class_type
      • loc, an object of typeX::locale_type


      expressionreturn typesemantics
      X::char_typeCharT Used to refer to the character type.
      X::string_typestd::basic_string<CharT>
      X::locale_type ACopyConstructible type that represents the locale used by the traits class.
      X::char_class_type ABitmaskType type that represents a particular character classification.
      X::length(p)std::size_t Returns: the smallesti such thatp[i]==0. Complexity is linear ini.
      v.translate(c)X::char_type Returns: a character such that for any characterd considered to be equivalent toc, thenv.translate(c)== v.translate(d).
      v.translate_nocase(c)X::char_type Returns: a character such that for any characterC considered to be equivalent toc without regard to case, thenv.translate_nocase(c)== v.translate_nocase(C).
      v.transform(F1, F2)X::string_type Returns: a sort key for the character sequence designated by the iterator range[F1, F2) such that if the character sequence[G1, G2) sorts before the character sequence[H1, H2), thenv.transform(G1, G2)< v.transform(H1, H2).
      v.transform_primary(F1, F2)X::string_type Returns: a sort key for the character sequence designated by the iterator range[F1, F2) such that if the character sequence[G1, G2) sorts before the character sequence[H1, H2) without regard to case, thenv.transform_primary(G1, G2)< v.transform_primary(H1, H2).
      v.lookup_collatename(F1, F2)X::string_type Returns:
      • An empty string if the character sequence is not a valid collating element
      • A sequence of characters that represents the collating element consisting of the character sequence designated by the iterator range[F1, F2) otherwise
      v.lookup_classname(F1, F2, b)X::char_class_type
      • Converts the character sequence designated by the iterator range[F1, F2) into a value of aBitmaskType that can subsequently be passed toisctype
      • Values returned fromlookup_classname can be bitwise or'ed together; the resulting value represents membership in either of the corresponding character classes
      • Ifb is true, the returned bitmask is suitable for matching characters without regard to their case.
      • Returns0 if the character sequence is not the name of a character class recognized byX.
      • The value returned shall be independent of the case of the characters in the sequence.
      v.isctype(c, cl)bool Returns: whetherc is a member of one of the character classes designated bycl or not.
      v.value(c, I)int Returns:
      • The value represented by the digitc in baseI if the characterc is a valid digit in baseI
      • -1 otherwise
      u.imbue(loc)X::locale_type
      • Imbuesu with the localeloc
      • Returns: The previous locale used byu if any
      v.getloc()X::locale_type Returns: The previous locale used byv if any.


      [edit]Standard library

      RegexTraits is satisfied by the following standard library classes:

      template<>class regex_traits<char>;
      template<>class regex_traits<wchar_t>;
      (since C++11)
      (since C++11)
      Retrieved from "https://en.cppreference.com/mwiki/index.php?title=cpp/named_req/RegexTraits&oldid=144946"

      [8]ページ先頭

      ©2009-2025 Movatter.jp