Boost logo

Boost :

From: Joel de Guzman (joel_at_[hidden])
Date: 2003-11-05 08:51:22


Joel de Guzman <joel_at_[hidden]> wrote:
> Brian McNamara <lorgon_at_[hidden]> wrote:

>> Is this:
>>
>>> match<int&> m; // unitialized
>>> m.value(3); // initializes m
>>
>> also supposed to be legal? I am guessing no, (for the same reason that
>> you can't say "int& x;") but I am not sure.
>
> No, that's not legal.

Let me clarify a bit:

    match<int&> m; // unitialized

is legal. But:

    match<int&> m; // unitialized
    m.value(3); // initializes m

Is illegal (asserts logic error, if that happens).

--
Joel de Guzman
http://www.boost-consulting.com
http://spirit.sf.net

Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk