Boost logo

Boost :

From: Larry Evans (cppljevans_at_[hidden])
Date: 2005-02-15 10:08:34


On 02/15/2005 06:47 AM, Joel de Guzman wrote:
> Larry Evans wrote:
>
>> On 02/15/2005 05:12 AM, Joel de Guzman wrote:
>>
>> Is the above insert a non-member function with signature:
>>
>> template<typename T1, ...,typename Tn>
>> void insert(fusion::set<T1,,,Tn>& s, Tk e);
>>
>> for some k in 1...n, and the above insert places element e
>> in s?
>
>
> Ehm...
>
> Yes, it is a non-member function. No, it does not mutate s.
> It does return another set. It is purely functional (no side-
> effects).
>
> Isn't the MPL doc clear enough?
> http://www.boost.org/libs/mpl/doc/refmanual/set.html
>

But that talks about adding a type, Tk to an mpl::set, not an instance
of that type e, to an instance of a set.

Maybe what you have in mind is that the elements are represented as
type, integral_c<Tk, e>? But then how could a function call (i.e.
insert(s,k) ) work since it's arguments are instances not types?

Consider tuple. With tuple<T1,T2>, any operation on an instance of
T1 or T2 you can do with tupel<T1,T2>. Likewise, I was thinking that
since fusion::set<T1,T2> has data, there would be operations for that
data, i.e. for instances of T1 and T2. IOW the operations would
include adding an instance of T1 or T2 to the fusion::set just as
with tuple<T1,T2> you have availble operations on instance of T1 or T2.


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