Boost logo

Boost :

Subject: Re: [boost] [serialization] Proposal: make 'version' trait (andothers)enable_if-friendly
From: Robert Ramey (ramey_at_[hidden])
Date: 2012-12-06 16:22:37

Gabriel Redner wrote:
> Hi Robert,
> Thanks for taking a look, and for developing the library!
>> Hmm - doesn't the fillowing work? - for each T used
>> template <>
>> struct version<Foo<t>::MyType>{
>> BOOST_STATIC_CONSTANT(unsigned int, value = 1);
>> };
>> I understand it might be a little more tedious and not that clever
>> but it's much, much, much less time consuming to understand,
>> documment, explain
>> and support. Your suggestion is clever - but I just don't think it's
>> cost effective.
> Technically - yes, I could probably enumerate all types. However, my
> example is severely simplified and in reality the 'Foo'-equivalent has
> several template parameters. Enumerating all of the combinations
> would create its own maintenance nightmare and essentially defeat the
> benefits of templating.
> I don't mean to dismiss your suggestion, but I think you are looking
> at things from the wrong perspective. Your objection seems not to be
> with the proposed library change, but with how I am going to use it.

It's not so much that, its with the work I have to do to implement it,
address compiler dependent issues, document it, explain it to people
who ask about it (it's not obvious), etc.

>> From the library's point of view, this is a change that increases
> flexibility while leaving existing use-cases untouched. Since this
> pattern is common in other boost libraries, I would say there is a
> clear need for it as well as precedent. If a user doesn't need the
> added flexibility, they can ignore the extra parameter. But, if a
> user *does* need it, it's a lifesaver.

There's nothing that prevents you from implementing your own change.

Actually I'm still trying to wrap my head around why

template<Foo<T>::MyType > doesn't work.

Robert Ramey

> Thanks,
> -Gabe
> _______________________________________________
> Unsubscribe & other changes:

Boost list run by bdawes at, gregod at, cpdaniel at, john at