forked from boostorg/fusion
Merge from trunk
[SVN r79274]
This commit is contained in:
26
include/boost/fusion/support/as_const.hpp
Normal file
26
include/boost/fusion/support/as_const.hpp
Normal file
@@ -0,0 +1,26 @@
|
||||
/*=============================================================================
|
||||
Copyright (c) 2012 Nathan Ridge
|
||||
|
||||
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_SUPPORT_AS_CONST_HPP
|
||||
#define BOOST_FUSION_SUPPORT_AS_CONST_HPP
|
||||
|
||||
namespace boost { namespace fusion { namespace extension
|
||||
{
|
||||
// A customization point that allows certain wrappers around
|
||||
// Fusion sequence elements (e.g. adt_attribute_proxy) to be
|
||||
// unwrapped in contexts where the element only needs to be
|
||||
// read. The library wraps accesses to Fusion elements in
|
||||
// such contexts with calls to this function. Users can
|
||||
// specialize this function for their own wrappers.
|
||||
template <typename T>
|
||||
const T& as_const(const T& obj)
|
||||
{
|
||||
return obj;
|
||||
}
|
||||
|
||||
}}}
|
||||
|
||||
#endif
|
@@ -7,6 +7,7 @@
|
||||
#if !defined(FUSION_IS_SEGMENTED_03202006_0015)
|
||||
#define FUSION_IS_SEGMENTED_03202006_0015
|
||||
|
||||
#include <boost/mpl/bool.hpp>
|
||||
#include <boost/fusion/support/tag_of.hpp>
|
||||
|
||||
namespace boost { namespace fusion
|
||||
@@ -41,8 +42,10 @@ namespace boost { namespace fusion
|
||||
{
|
||||
template <typename Sequence>
|
||||
struct is_segmented
|
||||
: extension::is_segmented_impl<typename traits::tag_of<Sequence>::type>::
|
||||
template apply<Sequence>
|
||||
: mpl::bool_<
|
||||
(bool)extension::is_segmented_impl<typename traits::tag_of<Sequence>::type>::
|
||||
template apply<Sequence>::type::value
|
||||
>
|
||||
{
|
||||
};
|
||||
}
|
||||
|
@@ -59,9 +59,11 @@ namespace boost { namespace fusion
|
||||
{
|
||||
template <typename T>
|
||||
struct is_sequence
|
||||
: extension::is_sequence_impl<
|
||||
: mpl::bool_<
|
||||
(bool)extension::is_sequence_impl<
|
||||
typename fusion::detail::tag_of<T>::type
|
||||
>::template apply<T>
|
||||
>::template apply<T>::type::value
|
||||
>
|
||||
{};
|
||||
|
||||
template <typename Sequence, typename Enable = void>
|
||||
|
@@ -7,6 +7,7 @@
|
||||
#if !defined(FUSION_IS_VIEW_03202006_0015)
|
||||
#define FUSION_IS_VIEW_03202006_0015
|
||||
|
||||
#include <boost/mpl/bool.hpp>
|
||||
#include <boost/fusion/support/detail/is_view.hpp>
|
||||
#include <boost/fusion/support/tag_of.hpp>
|
||||
|
||||
@@ -54,8 +55,10 @@ namespace boost { namespace fusion
|
||||
{
|
||||
template <typename T>
|
||||
struct is_view :
|
||||
extension::is_view_impl<typename fusion::detail::tag_of<T>::type>::
|
||||
template apply<T>::type
|
||||
mpl::bool_<
|
||||
(bool)extension::is_view_impl<typename fusion::detail::tag_of<T>::type>::
|
||||
template apply<T>::type::value
|
||||
>
|
||||
{};
|
||||
}
|
||||
}}
|
||||
|
Reference in New Issue
Block a user