mirror of
https://github.com/boostorg/fusion.git
synced 2025-07-29 12:07:36 +02:00
better adapt structs/classes implementation
[SVN r59913]
This commit is contained in:
@ -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
|
||||
|
Reference in New Issue
Block a user