Andrei Alexandrescu wrote:
Christopher Wright wrote:
Your first example was:
auto match (char[] source, char[] pattern, char[] options);

Your second example was:
auto match (char[] source, regex expression);

The second is good, but more typing than you said originally. The first is problematic.

Why is it problematic? Is the name "match" too common?

Andrei

No. What is the difference between those two? One is building a regex internally and not letting me store it; and it forces me to pass two parameters rather than one. The other takes a regex as a parameter, which I can store, and I can set both options (the pattern and the match options) once for all.

Reply via email to