RE2's LazyRE2: a pattern compiled on first use, once, thread-safely – static LazyRE2 re = {"a+"}; then RE2::FullMatch(text, *re). An aggregate, as RE2's, so the members are public; only pattern_ and options_ are meant to be set, by that brace initialisation.
More...
#include <re2.hpp>
|
| const RE2 & | operator* () const |
| | The compiled pattern.
|
| |
| const RE2 * | operator-> () const |
| | The compiled pattern.
|
| |
| const RE2 * | get () const |
| | The compiled pattern, compiled on the first call from any thread.
|
| |
|
|
const char * | pattern_ |
| | The pattern text.
|
| |
| RE2::CannedOptions | options_ {RE2::DefaultOptions} |
| |
|
std::optional< RE2 > | compiled_ {} |
| | Set once, on first use. Its {} spares a caller writing {.pattern_ = ...} a missing-initializer warning.
|
| |
|
std::once_flag | once_ {} |
| | Guards the first use.
|
| |
RE2's LazyRE2: a pattern compiled on first use, once, thread-safely – static LazyRE2 re = {"a+"}; then RE2::FullMatch(text, *re). An aggregate, as RE2's, so the members are public; only pattern_ and options_ are meant to be set, by that brace initialisation.
◆ get()
| const RE2 * real::compat::re2::LazyRE2::get |
( |
| ) |
const |
|
inline |
The compiled pattern, compiled on the first call from any thread.
- Returns
- A pointer to it.
◆ operator*()
| const RE2 & real::compat::re2::LazyRE2::operator* |
( |
| ) |
const |
|
inline |
The compiled pattern.
- Returns
- It, compiled on the first call.
◆ operator->()
| const RE2 * real::compat::re2::LazyRE2::operator-> |
( |
| ) |
const |
|
inline |
The compiled pattern.
- Returns
- A pointer to it, compiled on the first call.
◆ options_
The options it is compiled with.
The documentation for this struct was generated from the following file: