• Class / Function / Type

      std::
    • Header file

      <>
    • Other / All

    最終更新日時(UTC):
    が更新

    履歴 編集

    function
    <regex>

    std::regex_error::code

    概要

    エラーコードを取得する。

    戻り値

    コンストラクタで設定されたエラーコードを返す。

    #include <regex>
    
    int main()
    {
      try {
        std::regex re("("); // 開きカッコに対応する閉じカッコがない正規表現を指定
      }
      catch (std::regex_error& e) {
        // エラーコードを取得
        std::regex_constants::error_type code = e.code();
      }
    }
    

    出力

    バージョン

    言語

    • C++11

    処理系

    • Clang: 3.0 , 3.1 , 3.2 , 3.3 , 3.4 , 3.5 , 3.6
    • GCC: 4.9.0 , 4.9.1 , 5.0.0
    • ICC: ??
    • Visual C++: ??