regex_traits 类

描述元素的特性匹配。

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 类 信息操作 Elem类型的元素。

每个 regex_traits 对象来存放由某一些成员函数使用 regex_traits::locale 类型的对象。 默认区域设置是 regex_traits::locale()复制。 成员函数 imbue 替换为区域设置对象成员函数返回 getloc 和区域设置对象的副本。

要求

标头: <regex>

命名空间: std

请参见

参考

<regex>

regex_traits 类

regex_traits<char> 类

regex_traits<wchar_t> 类

其他资源

regex 成员