forked from boostorg/fusion
associative iterators & views
[SVN r57156]
This commit is contained in:
@ -9,6 +9,8 @@
|
||||
#define BOOST_FUSION_AT_KEY_20060304_1755
|
||||
|
||||
#include <boost/type_traits/is_const.hpp>
|
||||
#include <boost/fusion/algorithm/query/find.hpp>
|
||||
#include <boost/fusion/iterator/deref_data.hpp>
|
||||
#include <boost/fusion/support/tag_of.hpp>
|
||||
#include <boost/fusion/support/detail/access.hpp>
|
||||
|
||||
@ -25,15 +27,28 @@ namespace boost { namespace fusion
|
||||
template <typename Tag>
|
||||
struct at_key_impl
|
||||
{
|
||||
template <typename Sequence, typename Key>
|
||||
struct apply;
|
||||
template <typename Seq, typename Key>
|
||||
struct apply
|
||||
{
|
||||
typedef typename
|
||||
result_of::deref_data<
|
||||
typename result_of::find<Seq, Key>::type
|
||||
>::type
|
||||
type;
|
||||
|
||||
static type
|
||||
call(Seq& seq)
|
||||
{
|
||||
return fusion::deref_data(fusion::find<Key>(seq));
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
template <>
|
||||
struct at_key_impl<sequence_facade_tag>
|
||||
{
|
||||
template <typename Sequence, typename Key>
|
||||
struct apply : Sequence::template at_key<Sequence, Key> {};
|
||||
struct apply : Sequence::template at_key_impl<Sequence, Key> {};
|
||||
};
|
||||
|
||||
template <>
|
||||
|
Reference in New Issue
Block a user