Comment

Comment by bstamour

You can add a literal operator:

    auto operator "" _r(char const* str, unsigned long) {
      return std::regex{str};
    }
To avoid all the backslashes, you can use a raw string literal:

    int main() {
      auto myre = R"(^hello\w*)"_r;
    }
parent bstamour 6 years ago

No comments yet

Be the first to share your thoughts.

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton