diff options
Diffstat (limited to 'boost/context/detail/apply.hpp')
-rw-r--r-- | boost/context/detail/apply.hpp | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/boost/context/detail/apply.hpp b/boost/context/detail/apply.hpp index 54db844b9e..e1dd40a4db 100644 --- a/boost/context/detail/apply.hpp +++ b/boost/context/detail/apply.hpp @@ -15,13 +15,20 @@ #include <boost/config.hpp> #include <boost/context/detail/config.hpp> +#if defined(BOOST_NO_CXX17_STD_INVOKE) #include <boost/context/detail/invoke.hpp> +#endif #include <boost/context/detail/index_sequence.hpp> #ifdef BOOST_HAS_ABI_HEADERS # include BOOST_ABI_PREFIX #endif +#if defined(BOOST_MSVC) +# pragma warning(push) +# pragma warning(disable: 4100) +#endif + namespace boost { namespace context { namespace detail { @@ -29,9 +36,17 @@ namespace detail { template< typename Fn, typename Tpl, std::size_t ... I > auto apply_impl( Fn && fn, Tpl && tpl, index_sequence< I ... >) +#if defined(BOOST_NO_CXX17_STD_INVOKE) -> decltype( invoke( std::forward< Fn >( fn), std::get< I >( std::forward< Tpl >( tpl) ) ... ) ) +#else + -> decltype( std::invoke( std::forward< Fn >( fn), std::get< I >( std::forward< Tpl >( tpl) ) ... ) ) +#endif { +#if defined(BOOST_NO_CXX17_STD_INVOKE) return invoke( std::forward< Fn >( fn), std::get< I >( std::forward< Tpl >( tpl) ) ... ); +#else + return std::invoke( std::forward< Fn >( fn), std::get< I >( std::forward< Tpl >( tpl) ) ... ); +#endif } template< typename Fn, typename Tpl > @@ -48,6 +63,10 @@ apply( Fn && fn, Tpl && tpl) }}} +#if defined(BOOST_MSVC) +# pragma warning(pop) +#endif + #ifdef BOOST_HAS_ABI_HEADERS #include BOOST_ABI_SUFFIX #endif |