class mola::RegexCache

Overview

Holds a cached regex. Recompiles only if the expression changed. Thread-safe: multiple threads may call get_regex() concurrently.

#include <RegexCache.h>

class RegexCache
{
public:
    // construction

    RegexCache();
    RegexCache(const RegexCache& other);
    RegexCache(RegexCache&& other);

    // methods

    RegexCache& operator = (const RegexCache& other);
    RegexCache& operator = (RegexCache&& other);
    std::regex get_regex(const std::string& regExpression);
};