共用方式為


regex_traits Class

描述特性符合的項目。

template<class Elem>
    struct regex_traits {
    regex_traits();

    static size_type length(const char_type *str);
    char_type translate(char_type ch) const;
    char_type translate_nocase(char_type ch) const;
    template<class FwdIt>
        string_type transform(FwdIt first, FwdIt last) const;
    template<class FwdIt>
        string_type transform_primary(FwdIt first, FwdIt last) const;
    template<class FwdIt>
        char_class_type lookup_classname(FwdIt first, FwdIt last) const;
    template<class FwdIt>
        string_type lookup_collatename(FwdIt first, FwdIt last) const;
    bool isctype(char_type ch, char_class_type cls) const;
    int value(Elem ch, int base) const;
    locale_type imbue(locale_type loc);
    locale_type getloc() const;

    typedef Elem char_type;
    typedef T6 size_type;
    typedef basic_string<Elem> string_type;
    typedef T7 locale_type;
    typedef T8 char_class_type;
    };

參數

  • Elem
    描述項目型別。

備註

樣板類別描述各種類型的規則運算式特性Elem。樣板類別basic_regex Class使用此資訊來操作項目型別的Elem。

每個regex_traits物件擁有的物件型別的regex_traits::locale由其成員函式的部分。預設的地區設定是一份regex_traits::locale()。成員函式imbue會取代地區設定物件和成員函式getloc傳回的地區設定物件的複本。

需求

標頭: <regex>

Namespace: 標準

請參閱

參考

<regex>

regex_traits Class

regex_traits<char> Class

regex_traits<wchar_t> Class

其他資源

<regex> 成員