forked from boostorg/fusion
gpu-enable functions
This commit is contained in:
committed by
Eric Niebler
parent
867c7e5dfb
commit
c4f9f0d1b6
@@ -8,6 +8,7 @@
|
||||
#if !defined(BOOST_FUSION_DEQUE_DETAIL_KEYED_ELEMENT_26112006_1330)
|
||||
#define BOOST_FUSION_DEQUE_DETAIL_KEYED_ELEMENT_26112006_1330
|
||||
|
||||
#include <boost/fusion/support/config.hpp>
|
||||
#include <boost/fusion/support/detail/access.hpp>
|
||||
#include <boost/fusion/iterator/deref.hpp>
|
||||
#include <boost/fusion/iterator/next.hpp>
|
||||
@@ -22,9 +23,11 @@ namespace boost { namespace fusion { namespace detail
|
||||
struct nil_keyed_element
|
||||
{
|
||||
typedef fusion_sequence_tag tag;
|
||||
BOOST_FUSION_GPU_ENABLED
|
||||
void get();
|
||||
|
||||
template<typename It>
|
||||
BOOST_FUSION_GPU_ENABLED
|
||||
static nil_keyed_element
|
||||
from_iterator(It const&)
|
||||
{
|
||||
@@ -40,6 +43,7 @@ namespace boost { namespace fusion { namespace detail
|
||||
using Rest::get;
|
||||
|
||||
template <typename It>
|
||||
BOOST_FUSION_GPU_ENABLED
|
||||
static keyed_element
|
||||
from_iterator(It const& it)
|
||||
{
|
||||
@@ -47,11 +51,13 @@ namespace boost { namespace fusion { namespace detail
|
||||
*it, base::from_iterator(fusion::next(it)));
|
||||
}
|
||||
|
||||
BOOST_FUSION_GPU_ENABLED
|
||||
keyed_element(keyed_element const& rhs)
|
||||
: Rest(rhs.get_base()), value_(rhs.value_)
|
||||
{}
|
||||
|
||||
#if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
|
||||
BOOST_FUSION_GPU_ENABLED
|
||||
keyed_element(keyed_element&& rhs)
|
||||
: Rest(std::forward<Rest>(rhs.forward_base()))
|
||||
, value_(std::forward<Value>(rhs.value_))
|
||||
@@ -59,6 +65,7 @@ namespace boost { namespace fusion { namespace detail
|
||||
#endif
|
||||
|
||||
template <typename U, typename Rst>
|
||||
BOOST_FUSION_GPU_ENABLED
|
||||
keyed_element(keyed_element<Key, U, Rst> const& rhs)
|
||||
: Rest(rhs.get_base()), value_(rhs.value_)
|
||||
{}
|
||||
@@ -66,33 +73,39 @@ namespace boost { namespace fusion { namespace detail
|
||||
#if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
|
||||
#endif
|
||||
|
||||
BOOST_FUSION_GPU_ENABLED
|
||||
Rest& get_base()
|
||||
{
|
||||
return *this;
|
||||
}
|
||||
|
||||
BOOST_FUSION_GPU_ENABLED
|
||||
Rest const& get_base() const
|
||||
{
|
||||
return *this;
|
||||
}
|
||||
|
||||
#if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
|
||||
BOOST_FUSION_GPU_ENABLED
|
||||
Rest&& forward_base()
|
||||
{
|
||||
return std::forward<Rest>(*static_cast<Rest*>(this));
|
||||
}
|
||||
#endif
|
||||
|
||||
BOOST_FUSION_GPU_ENABLED
|
||||
typename cref_result<Value>::type get(Key) const
|
||||
{
|
||||
return value_;
|
||||
}
|
||||
|
||||
BOOST_FUSION_GPU_ENABLED
|
||||
typename ref_result<Value>::type get(Key)
|
||||
{
|
||||
return value_;
|
||||
}
|
||||
|
||||
BOOST_FUSION_GPU_ENABLED
|
||||
keyed_element(
|
||||
typename detail::call_param<Value>::type value
|
||||
, Rest const& rest)
|
||||
@@ -100,17 +113,20 @@ namespace boost { namespace fusion { namespace detail
|
||||
{}
|
||||
|
||||
#if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
|
||||
BOOST_FUSION_GPU_ENABLED
|
||||
keyed_element(Value&& value, Rest&& rest)
|
||||
: Rest(std::forward<Rest>(rest))
|
||||
, value_(std::forward<Value>(value))
|
||||
{}
|
||||
#endif
|
||||
|
||||
BOOST_FUSION_GPU_ENABLED
|
||||
keyed_element()
|
||||
: Rest(), value_()
|
||||
{}
|
||||
|
||||
template<typename U, typename Rst>
|
||||
BOOST_FUSION_GPU_ENABLED
|
||||
keyed_element& operator=(keyed_element<Key, U, Rst> const& rhs)
|
||||
{
|
||||
base::operator=(static_cast<Rst const&>(rhs)); // cast for msvc-7.1
|
||||
@@ -118,6 +134,7 @@ namespace boost { namespace fusion { namespace detail
|
||||
return *this;
|
||||
}
|
||||
|
||||
BOOST_FUSION_GPU_ENABLED
|
||||
keyed_element& operator=(keyed_element const& rhs)
|
||||
{
|
||||
base::operator=(rhs);
|
||||
@@ -126,6 +143,7 @@ namespace boost { namespace fusion { namespace detail
|
||||
}
|
||||
|
||||
#if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
|
||||
BOOST_FUSION_GPU_ENABLED
|
||||
keyed_element& operator=(keyed_element&& rhs)
|
||||
{
|
||||
base::operator=(std::forward<keyed_element>(rhs));
|
||||
|
Reference in New Issue
Block a user