Boost logo

Boost Users :

Subject: Re: [Boost-users] [boost][mpl] Detect a type sequence type
From: Jeffrey Lee Hellrung, Jr. (jeffrey.hellrung_at_[hidden])
Date: 2012-12-07 18:45:47


On Fri, Dec 7, 2012 at 8:57 AM, Klaim - Joël Lamotte <mjklaim_at_[hidden]>wrote:

>
>
>
> On Fri, Dec 7, 2012 at 5:40 PM, Jeffrey Lee Hellrung, Jr. <
> jeffrey.hellrung_at_[hidden]> wrote:
>
>> Is mpl::is_sequence what you're looking for?
>>
>> - Jeff
>>
>>
> How did I miss that O___O
> Thanks it's exactly what I was looking for but not at the right section of
> the doc.
> It is supposed to work only with MPL containers, isn't it?
>

Yes, I believe so, but there is an extension framework within Boost.MPL to
enable other types to be MPL-compatible sequences, if you needed that.

If you wanted to actually be more restrictive, I believe you might be able
to retrieve the dispatch tag of the MPL sequence and check that it's a
vector_tag, list_tag, etc. (I'm writing that all from fuzzy memory so I
don't know if I have the terminology and names right). And I think if a
type is not an MPL sequence, it returns some dummy "n/a" tag. Check the
documentation and/or header files (specifically is_sequence.hpp, probably).

- Jeff



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