forked from boostorg/fusion
Improve vector value_at performance.
This commit is contained in:
@ -23,7 +23,6 @@
|
|||||||
///////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
#include <boost/fusion/container/vector/vector_fwd.hpp>
|
#include <boost/fusion/container/vector/vector_fwd.hpp>
|
||||||
#include <boost/type_traits/declval.hpp>
|
#include <boost/type_traits/declval.hpp>
|
||||||
#include <boost/type_traits/remove_cv.hpp>
|
|
||||||
|
|
||||||
namespace boost { namespace fusion
|
namespace boost { namespace fusion
|
||||||
{
|
{
|
||||||
@ -31,8 +30,12 @@ namespace boost { namespace fusion
|
|||||||
|
|
||||||
namespace vector_detail
|
namespace vector_detail
|
||||||
{
|
{
|
||||||
template <typename I, typename ...T>
|
template <std::size_t I, typename T>
|
||||||
struct vector_data;
|
struct store;
|
||||||
|
|
||||||
|
template <std::size_t N, typename U>
|
||||||
|
static inline BOOST_FUSION_GPU_ENABLED
|
||||||
|
U value_at_impl(store<N, U> const volatile*);
|
||||||
}
|
}
|
||||||
|
|
||||||
namespace extension
|
namespace extension
|
||||||
@ -46,8 +49,9 @@ namespace boost { namespace fusion
|
|||||||
template <typename Sequence, typename N>
|
template <typename Sequence, typename N>
|
||||||
struct apply
|
struct apply
|
||||||
{
|
{
|
||||||
typedef typename boost::remove_cv<Sequence>::type seq;
|
typedef
|
||||||
typedef typename mpl::identity<decltype(seq::template value_at_impl<N::value>(boost::declval<seq*>()))>::type::type type;
|
decltype(vector_detail::value_at_impl<N::value>(boost::declval<Sequence*>()))
|
||||||
|
type;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -258,10 +258,6 @@ namespace boost { namespace fusion
|
|||||||
{
|
{
|
||||||
return at_detail<J::value>(this);
|
return at_detail<J::value>(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
template <std::size_t N, typename U>
|
|
||||||
static BOOST_FUSION_GPU_ENABLED
|
|
||||||
mpl::identity<U> value_at_impl(store<N, U>*);
|
|
||||||
};
|
};
|
||||||
} // namespace boost::fusion::vector_detail
|
} // namespace boost::fusion::vector_detail
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user