Formal Review of std.regex (FReD)
Fawzi Mohamed
fawzi at gmx.ch
Sat Oct 22 18:25:01 PDT 2011
On Oct 22, 2011, at 12:05 PM, Dmitry Olshansky wrote:
> On 22.10.2011 20:56, Rainer Schuetze wrote:
>> […]
>> I think, both versions use implementation specifics, maybe there should
>> be a documented way to test for being initialized.
>>
>
> Definitely. How about adding an empty property + opCast to bool, with that you'd get:
> if(!re)
> {
> //create re
> }
I think this is better, should one ever want to switch to plain pointer…, also you need less thinking if it works like for classes.
> and a bit more verbose:
> if(re.empty)
> {
> //create re
> }
More information about the Digitalmars-d
mailing list