On 12/26/10 8:54 AM, spir wrote:
On Sun, 26 Dec 2010 14:54:12 +0100
Andrej Mitrovic<[email protected]>  wrote:

int i;    // auto-initialized to int.init
int i = void; // not initialized

Thanks. Actually this solves my "semantic" issue, did not even think at 'void'. 
(I will use it often). By the way, I don't want to play the superhero with uninitialised 
values, simply sometimes the initial value cannot be known at declare place.
        int i;
        if (foo)
           i=0;
        else if (bar)
           i=1;
        else
           i=2;
        playWith(i);

Problem with = void for elaborate types is that you need to use emplace(&var, expr) to initialize them later.

Andrei

Reply via email to