Files
boost_fusion/include/boost/fusion/adapted/class/detail/at_impl.hpp

56 lines
1.4 KiB
C++
Raw Normal View History

2009-10-04 16:59:37 +00:00
/*=============================================================================
Copyright (c) 2010 Christopher Schmidt
2009-10-04 16:59:37 +00:00
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
==============================================================================*/
#ifndef BOOST_FUSION_ADAPTED_DETAIL_CLASS_AT_IMPL_HPP
#define BOOST_FUSION_ADAPTED_DETAIL_CLASS_AT_IMPL_HPP
2009-10-04 16:59:37 +00:00
#include <boost/mpl/if.hpp>
#include <boost/type_traits/is_const.hpp>
#include <boost/type_traits/remove_const.hpp>
namespace boost { namespace fusion { namespace extension
2009-10-04 16:59:37 +00:00
{
template<typename>
struct at_impl;
2009-10-04 16:59:37 +00:00
template <>
struct at_impl<class_tag>
2009-10-04 16:59:37 +00:00
{
template<typename Seq, typename N>
struct apply
2009-10-04 16:59:37 +00:00
{
typedef
extension::struct_member<
typename remove_const<Seq>::type
, N::value
>
member;
typedef typename
mpl::if_<
is_const<Seq>
, typename member::get_type
, typename member::proxy
>::type
type;
static type
call(Seq& seq)
2009-10-04 16:59:37 +00:00
{
return member::call(seq);
}
2009-10-04 16:59:37 +00:00
};
};
template <>
struct at_impl<assoc_class_tag>
: at_impl<class_tag>
{};
}}}
2009-10-04 16:59:37 +00:00
#endif