REAL
Regular Expression Algorithmic Library — constexpr C++20 regex
Loading...
Searching...
No Matches
real::compat::regex_error Class Reference

std::regex_error-compatible exception. More...

#include <regex_core.hpp>

Inheritance diagram for real::compat::regex_error:
[legend]
Collaboration diagram for real::compat::regex_error:
[legend]

Public Member Functions

 regex_error (const std::regex_error &error)
 From a std backend error (the fallback path); keeps std's exact code.
 
 regex_error (std::regex_constants::error_type code, std::string message)
 With an explicit code and message — the strict-policy rejection of a pattern REAL cannot represent linearly (error_complexity), carrying a REAL-identifiable message.
 
const char * what () const noexcept override
 

Private Attributes

std::string message_
 The originating error's detailed message.
 

Detailed Description

std::regex_error-compatible exception.

Thrown on two paths, both preserving the std::regex_error contract:

  • Invalid for both backends (a syntax error): real rejects, and so does std — the exact std .code() is preserved and what() keeps std's message, so a syntax error is byte-for-byte std.
  • Strict-policy rejection (policy): a pattern real cannot represent linearly but std could (a backreference, an unbounded lookaround, a POSIX class) — code() is error_complexity and what() carries a REAL-identifiable message. Under policy::fallback this path delegates to std instead of throwing, so the only thrown case there is the invalid-for-both one above.

Definition at line 113 of file regex_core.hpp.

Constructor & Destructor Documentation

◆ regex_error() [1/2]

real::compat::regex_error::regex_error ( const std::regex_error &  error)
inlineexplicit

From a std backend error (the fallback path); keeps std's exact code.

Definition at line 118 of file regex_core.hpp.

◆ regex_error() [2/2]

real::compat::regex_error::regex_error ( std::regex_constants::error_type  code,
std::string  message 
)
inline

With an explicit code and message — the strict-policy rejection of a pattern REAL cannot represent linearly (error_complexity), carrying a REAL-identifiable message.

Definition at line 125 of file regex_core.hpp.

Member Function Documentation

◆ what()

const char * real::compat::regex_error::what ( ) const
inlineoverridenoexcept

Definition at line 131 of file regex_core.hpp.

Member Data Documentation

◆ message_

std::string real::compat::regex_error::message_
private

The originating error's detailed message.

Definition at line 138 of file regex_core.hpp.


The documentation for this class was generated from the following file: