Boost logo

Boost Users :

From: Sohail Somani (sohail_at_[hidden])
Date: 2008-03-27 15:37:23


On Thu, 27 Mar 2008 16:32:25 -0300, Felipe Magno de Almeida wrote:

>> > Anyway, if there was an is_tuple<T> metafunction, there would be a
>> > more elegant way to do it:
>>
>> Hmm, no I lied. You couldn't do it this way because then the overload
>> would be ambiguous when it matched. I think...
>
> Ambigous with what?

Ambiguous with the other boost::serialization::serialize function. I was
thinking of:

template<typename Archive, typename TupleType>
boost::enable_if<is_tuple<TupleType>::value,void>::type
serialize(Archive & ar, TupleType & t, const unsigned int);

But the function that gets called when anything is serialized is:

template<typename Archive, typename T>
void serialize(Archive & ar, T & t, const unsigned int);

So when is_tuple<TupleType>::value is true, then there are two functions
which match the required signature => ambiguous. Atleast in my head
anyway.

Anyway, the Boost.PP version is fine :-)

-- 
Sohail Somani
http://uint32t.blogspot.com

Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net