2010-02-22 22:55:54 +00:00
|
|
|
/*=============================================================================
|
2010-02-25 20:10:37 +00:00
|
|
|
Copyright (c) 2001-2009 Joel de Guzman
|
|
|
|
Copyright (c) 2005-2006 Dan Marsden
|
2010-02-22 22:55:54 +00:00
|
|
|
Copyright (c) 2010 Christopher Schmidt
|
|
|
|
|
|
|
|
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-09-16 16:33:25 +00:00
|
|
|
#ifndef BOOST_FUSION_ADAPTED_ADT_DETAIL_EXTENSION_HPP
|
|
|
|
#define BOOST_FUSION_ADAPTED_ADT_DETAIL_EXTENSION_HPP
|
2010-02-22 22:55:54 +00:00
|
|
|
|
2014-01-09 17:58:06 -08:00
|
|
|
#include <boost/fusion/support/config.hpp>
|
2010-02-25 20:10:37 +00:00
|
|
|
#include <boost/type_traits/remove_const.hpp>
|
|
|
|
#include <boost/type_traits/remove_reference.hpp>
|
2012-05-17 01:10:20 +00:00
|
|
|
#include <boost/fusion/support/as_const.hpp>
|
|
|
|
#include <boost/fusion/adapted/struct/detail/extension.hpp>
|
2010-02-22 22:55:54 +00:00
|
|
|
|
2012-05-17 01:10:20 +00:00
|
|
|
namespace boost { namespace fusion
|
2015-03-03 02:21:02 +09:00
|
|
|
{
|
2012-05-17 01:10:20 +00:00
|
|
|
namespace detail
|
|
|
|
{
|
|
|
|
template <typename T, typename Dummy>
|
|
|
|
struct get_identity
|
|
|
|
: remove_const<typename remove_reference<T>::type>
|
|
|
|
{};
|
|
|
|
}
|
2015-03-03 02:21:02 +09:00
|
|
|
|
2012-05-17 01:10:20 +00:00
|
|
|
namespace extension
|
|
|
|
{
|
|
|
|
// Overload as_const() to unwrap adt_attribute_proxy.
|
|
|
|
template <typename T, int N, bool Const>
|
2015-03-03 02:21:02 +09:00
|
|
|
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
2012-05-17 01:10:20 +00:00
|
|
|
typename adt_attribute_proxy<T, N, Const>::type as_const(const adt_attribute_proxy<T, N, Const>& proxy)
|
|
|
|
{
|
|
|
|
return proxy.get();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}}
|
2010-02-22 22:55:54 +00:00
|
|
|
|
|
|
|
#endif
|