From c9ae4fc8869faace8eaec797c9c6d90328832f25 Mon Sep 17 00:00:00 2001 From: Kohei Takahashi Date: Thu, 13 Nov 2014 20:04:40 +0900 Subject: [PATCH] result_of::at::type is't defined when sizeof of sequence is less than N, close #6507, #7651 Original proposals suggest making as a hard error (by MPL asssert / static assert), however this change just doesn't define due to SFINAE-friendly. --- include/boost/fusion/sequence/intrinsic/at.hpp | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/include/boost/fusion/sequence/intrinsic/at.hpp b/include/boost/fusion/sequence/intrinsic/at.hpp index b2b012b1..fdfa72a6 100644 --- a/include/boost/fusion/sequence/intrinsic/at.hpp +++ b/include/boost/fusion/sequence/intrinsic/at.hpp @@ -9,6 +9,9 @@ #include #include +#include +#include +#include #include #include #include @@ -56,12 +59,23 @@ namespace boost { namespace fusion struct at_impl; } + namespace detail + { + template + struct at_impl + : mpl::if_< + mpl::less::template apply::type> + , typename extension::at_impl::template apply + , mpl::empty_base + >::type + {}; + } + namespace result_of { template struct at - : extension::at_impl::type>:: - template apply + : detail::at_impl::type> {}; template