Boost logo

Boost :

Subject: Re: [boost] Adding spirit::is_container to boost::traits
From: Felipe Magno de Almeida (felipe.m.almeida_at_[hidden])
Date: 2014-05-27 11:25:54


On Tue, May 27, 2014 at 12:08 PM, Rodrigo Madera
<rodrigo.madera_at_[hidden]> wrote:
> On Tue, May 27, 2014 at 11:28 AM, Felipe Magno de Almeida
> <felipe.m.almeida_at_[hidden]> wrote:
>> That traits is meant for users to specialize if they work with non-STL
>> container types. It doesn't seem very appropriate for boost.traits
>> because they can't deduce it in C++03 and in C++17 we will have
>> concepts lite anyway.
>
> I beg to differ.
>
> The need to identify container types (be it STL or user defined types)
> arises in some contexts.

I agree completely with this statement. But that is not what
spirit::traits::is_container is.

> It would be very useful to have these in a
> standard boost library like traits, and not (ab)using Spirit internals
> for that.

+1 again.

> To me, having is_container looks interesting for boost::traits.

Having a is_container would be great, and we will have that in C++17
AFAIK. You might be able to SFINAE something to detect begin, end and
the necessary member typedefs, but there's no way to test ownership
AFAIK.

> Regards,
> Madera

Regards,

-- 
Felipe Magno de Almeida

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