Thank you both for your replies, they make perfect sense.
I filed a bug report here:
http://d.puremagic.com/issues/show_bug.cgi?id=8637
On 09-Sep-12 23:04, monarch_dodra wrote:
> Given this little program testing regexs, I decided to replace one of
> the example's assert with an enforce:
>
>
> import std.regex;
> import std.exception;
> void main()
> {
> auto m = match("hello world", regex("world"));
> assert(m)
On Sunday, September 09, 2012 21:04:58 monarch_dodra wrote:
> So I'll rephrase my 1):
> Why the difference in behavior regarding the return value? Is it
> just historical/no real reason, or is there something for me to
> learn here?
Just look at the examples. You're supposed to be able to use enfo
Given this little program testing regexs, I decided to replace
one of the example's assert with an enforce:
import std.regex;
import std.exception;
void main()
{
auto m = match("hello world", regex("world"));
assert(m);
enforce(m); // <-- HERE
enforce(cast(bool)m);
e