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

命名空间: std

请参见

参考

<regex>

regex_traits Class

regex_traits<char> Class

regex_traits<wchar_t> Class

其他资源

regex 成员