better adapt structs/classes implementation

[SVN r59913]
This commit is contained in:
Christopher Schmidt
2010-02-25 20:10:37 +00:00
parent f84bc30bd3
commit e67765747d
39 changed files with 266 additions and 701 deletions

View File

@ -5,13 +5,8 @@
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
==============================================================================*/
#ifndef BOOST_FUSION_ADAPTED_DETAIL_STRUCT_DEREF_IMPL_HPP
#define BOOST_FUSION_ADAPTED_DETAIL_STRUCT_DEREF_IMPL_HPP
#include <boost/fusion/support/detail/access.hpp>
#include <boost/mpl/eval_if.hpp>
#include <boost/type_traits/remove_const.hpp>
#include <boost/type_traits/is_const.hpp>
#ifndef BOOST_FUSION_ADAPTED_STRUCT_DETAIL_DEREF_IMPL_HPP
#define BOOST_FUSION_ADAPTED_STRUCT_DETAIL_DEREF_IMPL_HPP
namespace boost { namespace fusion { namespace extension
{
@ -24,33 +19,23 @@ namespace boost { namespace fusion { namespace extension
template <typename It>
struct apply
{
typedef
extension::struct_member<
typename remove_const<typename It::seq_type>::type
, It::index::value
>
member;
typedef typename
extension::struct_member<
typename remove_const<typename It::seq_type>::type
, It::index::value
>::template apply<typename It::seq_type>
impl;
typedef typename
mpl::eval_if<
is_const<typename It::seq_type>
, detail::cref_result<member>
, detail::ref_result<member>
>::type
type;
typedef typename impl::type type;
static type
call(It const& it)
{
return member::call(*it.seq);
}
static
type
call(It const& it)
{
return impl::call(*it.seq);
}
};
};
template <>
struct deref_impl<assoc_struct_iterator_tag>
: deref_impl<struct_iterator_tag>
{};
}}}
#endif