mirror of
https://github.com/boostorg/fusion.git
synced 2025-07-22 00:32:53 +02:00
Improve vector value_at performance.
This commit is contained in:
@ -23,7 +23,6 @@
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
#include <boost/fusion/container/vector/vector_fwd.hpp>
|
||||
#include <boost/type_traits/declval.hpp>
|
||||
#include <boost/type_traits/remove_cv.hpp>
|
||||
|
||||
namespace boost { namespace fusion
|
||||
{
|
||||
@ -31,8 +30,12 @@ namespace boost { namespace fusion
|
||||
|
||||
namespace vector_detail
|
||||
{
|
||||
template <typename I, typename ...T>
|
||||
struct vector_data;
|
||||
template <std::size_t I, typename T>
|
||||
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
|
||||
@ -46,8 +49,9 @@ namespace boost { namespace fusion
|
||||
template <typename Sequence, typename N>
|
||||
struct apply
|
||||
{
|
||||
typedef typename boost::remove_cv<Sequence>::type seq;
|
||||
typedef typename mpl::identity<decltype(seq::template value_at_impl<N::value>(boost::declval<seq*>()))>::type::type type;
|
||||
typedef
|
||||
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);
|
||||
}
|
||||
|
||||
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
|
||||
|
||||
|
Reference in New Issue
Block a user