summaryrefslogtreecommitdiff
path: root/boost/fusion/sequence/intrinsic/at.hpp
diff options
context:
space:
mode:
authorDongHun Kwak <dh0128.kwak@samsung.com>2016-03-21 06:45:20 (GMT)
committerDongHun Kwak <dh0128.kwak@samsung.com>2016-03-21 06:46:37 (GMT)
commit733b5d5ae2c5d625211e2985ac25728ac3f54883 (patch)
treea5b214744b256f07e1dc2bd7273035a7808c659f /boost/fusion/sequence/intrinsic/at.hpp
parent08c1e93fa36a49f49325a07fe91ff92c964c2b6c (diff)
downloadboost-733b5d5ae2c5d625211e2985ac25728ac3f54883.zip
boost-733b5d5ae2c5d625211e2985ac25728ac3f54883.tar.gz
boost-733b5d5ae2c5d625211e2985ac25728ac3f54883.tar.bz2
Imported Upstream version 1.58.0upstream/1.58.0refs/changes/33/62933/1
Change-Id: If0072143aa26874812e0db6872e1efb10a3e5e94 Signed-off-by: DongHun Kwak <dh0128.kwak@samsung.com>
Diffstat (limited to 'boost/fusion/sequence/intrinsic/at.hpp')
-rw-r--r--boost/fusion/sequence/intrinsic/at.hpp26
1 files changed, 20 insertions, 6 deletions
diff --git a/boost/fusion/sequence/intrinsic/at.hpp b/boost/fusion/sequence/intrinsic/at.hpp
index aa0d974..fdfa72a 100644
--- a/boost/fusion/sequence/intrinsic/at.hpp
+++ b/boost/fusion/sequence/intrinsic/at.hpp
@@ -9,6 +9,9 @@
#include <boost/fusion/support/config.hpp>
#include <boost/mpl/int.hpp>
+#include <boost/mpl/if.hpp>
+#include <boost/mpl/less.hpp>
+#include <boost/mpl/empty_base.hpp>
#include <boost/type_traits/is_const.hpp>
#include <boost/fusion/sequence/intrinsic_fwd.hpp>
#include <boost/fusion/support/tag_of.hpp>
@@ -56,12 +59,23 @@ namespace boost { namespace fusion
struct at_impl<std_tuple_tag>;
}
+ namespace detail
+ {
+ template <typename Sequence, typename N, typename Tag>
+ struct at_impl
+ : mpl::if_<
+ mpl::less<N, typename extension::size_impl<Tag>::template apply<Sequence>::type>
+ , typename extension::at_impl<Tag>::template apply<Sequence, N>
+ , mpl::empty_base
+ >::type
+ {};
+ }
+
namespace result_of
{
template <typename Sequence, typename N>
struct at
- : extension::at_impl<typename detail::tag_of<Sequence>::type>::
- template apply<Sequence, N>
+ : detail::at_impl<Sequence, N, typename detail::tag_of<Sequence>::type>
{};
template <typename Sequence, int N>
@@ -72,7 +86,7 @@ namespace boost { namespace fusion
template <typename N, typename Sequence>
- BOOST_FUSION_GPU_ENABLED
+ BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
inline typename
lazy_disable_if<
is_const<Sequence>
@@ -84,7 +98,7 @@ namespace boost { namespace fusion
}
template <typename N, typename Sequence>
- BOOST_FUSION_GPU_ENABLED
+ BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
inline typename result_of::at<Sequence const, N>::type
at(Sequence const& seq)
{
@@ -92,7 +106,7 @@ namespace boost { namespace fusion
}
template <int N, typename Sequence>
- BOOST_FUSION_GPU_ENABLED
+ BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
inline typename
lazy_disable_if<
is_const<Sequence>
@@ -104,7 +118,7 @@ namespace boost { namespace fusion
}
template <int N, typename Sequence>
- BOOST_FUSION_GPU_ENABLED
+ BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
inline typename result_of::at_c<Sequence const, N>::type
at_c(Sequence const& seq)
{