Boost logo

Boost Users :

Subject: [Boost-users] [mpl] Constant time mpl::contains<mpl::set>
From: strasser_at_[hidden]
Date: 2010-03-28 18:26:38


Hi,

I'd like to be able to query if a MPL Sequence contains a certain
type, aka mpl::contains.
But mpl::contains is documented to always have linear complexity, even
for mpl::set's. How can you differentiate between types of MPL
Sequences, so you can use mpl::at for sets and mpl::contains for
vectors?
MPL itself seems to do this by template specialization, e.g. for
mpl::at, which is overloaded.
But template specialization relies on MPL implementation details, is
there a way to detect any type that models an associative sequence?
I can't find something like mpl::is_set nor a tag to dispatch with in
the AssociativeSequence concept.

Thank you,

Stefan


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