2007-10-21 00:52:09 +00:00
|
|
|
/*=============================================================================
|
|
|
|
Copyright (c) 2001-2006 Joel de Guzman
|
|
|
|
Copyright (c) 2005-2006 Dan Marsden
|
2010-02-22 22:55:54 +00:00
|
|
|
Copyright (c) 2009-2010 Christopher Schmidt
|
2007-10-21 00:52:09 +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)
|
|
|
|
==============================================================================*/
|
2010-02-22 22:55:54 +00:00
|
|
|
|
|
|
|
#ifndef BOOST_FUSION_ADAPTED_DETAIL_STRUCT_AT_IMPL_HPP
|
|
|
|
#define BOOST_FUSION_ADAPTED_DETAIL_STRUCT_AT_IMPL_HPP
|
2007-10-21 00:52:09 +00:00
|
|
|
|
|
|
|
#include <boost/fusion/support/detail/access.hpp>
|
2010-02-22 22:55:54 +00:00
|
|
|
#include <boost/mpl/eval_if.hpp>
|
|
|
|
#include <boost/type_traits/remove_const.hpp>
|
|
|
|
#include <boost/type_traits/is_const.hpp>
|
2007-10-21 00:52:09 +00:00
|
|
|
|
2010-02-22 22:55:54 +00:00
|
|
|
namespace boost { namespace fusion { namespace extension
|
2007-10-21 00:52:09 +00:00
|
|
|
{
|
2010-02-22 22:55:54 +00:00
|
|
|
template<typename>
|
|
|
|
struct at_impl;
|
2007-10-21 00:52:09 +00:00
|
|
|
|
2010-02-22 22:55:54 +00:00
|
|
|
template <>
|
|
|
|
struct at_impl<struct_tag>
|
2007-10-21 00:52:09 +00:00
|
|
|
{
|
2010-02-22 22:55:54 +00:00
|
|
|
template <typename Seq, typename N>
|
|
|
|
struct apply
|
2007-10-21 00:52:09 +00:00
|
|
|
{
|
2010-02-22 22:55:54 +00:00
|
|
|
typedef
|
|
|
|
extension::struct_member<
|
|
|
|
typename remove_const<Seq>::type
|
|
|
|
, N::value
|
|
|
|
>
|
|
|
|
member;
|
|
|
|
|
|
|
|
typedef typename
|
|
|
|
mpl::eval_if<
|
|
|
|
is_const<Seq>
|
|
|
|
, detail::cref_result<member>
|
|
|
|
, detail::ref_result<member>
|
|
|
|
>::type
|
|
|
|
type;
|
|
|
|
|
|
|
|
static type
|
|
|
|
call(Seq& seq)
|
2007-10-21 00:52:09 +00:00
|
|
|
{
|
2010-02-22 22:55:54 +00:00
|
|
|
return member::call(seq);
|
|
|
|
}
|
2007-10-21 00:52:09 +00:00
|
|
|
};
|
2010-02-22 22:55:54 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
template <>
|
|
|
|
struct at_impl<assoc_struct_tag>
|
|
|
|
: at_impl<struct_tag>
|
|
|
|
{};
|
|
|
|
}}}
|
2007-10-21 00:52:09 +00:00
|
|
|
|
|
|
|
#endif
|