Boost logo

Boost :

From: Vincent Finn (vincent_finn_at_[hidden])
Date: 2002-10-10 04:39:42


Dave Gomboc wrote:
>>>Usage:
>>>
>>>init(container)(value1)(value2)(value3);
>>>
>>>or
>>>
>>>init(map)(key1, value1)(key2, value2);
>>
>>nice stuff! It is considerably simpler than my initial code. I presume
>>you like the lisp syntax better :-)? As you know, I don't think it is
>>the right one. One could choose to support both, though. The problem of
>>missing a value in the assignment to the map is hypothetical. If I wan't
>>to map int to int, I can make the mapping just as clear by using newline
>>or tabs:
>>
>>set_map( m ) += 1,2 2,3 3,4 5,6;
>>
>>set_map( m ) += 1,2
>> 2,3
>> 3,4;
>>
>>The first version is the best. One would never miss a value that way and the
>>values are easier to read than something burried in paranthesis:
>>
>>init( m )(1,2)(2,3)(3,4);
>
>
> Personally, I prefer the parentheses -- the tuples are immediately
> visible. It's downright non-intuitive to use whitespace as a tuple
> separator.

But then a vector would be like this
init(v)(1)(2)(3);
which is a lot less elegant than
int(v) += 1, 2, 3;

        Vin
        Vin


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