summaryrefslogtreecommitdiff
path: root/boost/variant/detail/substitute.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'boost/variant/detail/substitute.hpp')
-rw-r--r--boost/variant/detail/substitute.hpp28
1 files changed, 27 insertions, 1 deletions
diff --git a/boost/variant/detail/substitute.hpp b/boost/variant/detail/substitute.hpp
index 2579eb51bb..f9d29a50c5 100644
--- a/boost/variant/detail/substitute.hpp
+++ b/boost/variant/detail/substitute.hpp
@@ -145,7 +145,32 @@ struct substitute<
Ts, Dest, Source
>::type...> type;
};
-#endif // !defined(BOOST_VARIANT_DO_NOT_USE_VARIADIC_TEMPLATES)
+
+//
+// function specializations
+//
+template <
+ typename R
+ , typename... A
+ , typename Dest
+ , typename Source
+ >
+struct substitute<
+ R (*)(A...)
+ , Dest
+ , Source
+ BOOST_MPL_AUX_LAMBDA_ARITY_PARAM(mpl::int_<-1>)
+ >
+{
+private:
+ typedef typename substitute< R, Dest, Source >::type r;
+
+public:
+ typedef r (*type)(typename substitute<
+ A, Dest, Source
+ >::type...);
+};
+#else
#define BOOST_VARIANT_AUX_SUBSTITUTE_TYPEDEF_IMPL(N) \
typedef typename substitute< \
@@ -164,6 +189,7 @@ struct substitute<
#undef BOOST_VARIANT_AUX_SUBSTITUTE_TYPEDEF_IMPL
#undef BOOST_VARIANT_AUX_SUBSTITUTE_TYPEDEF
+#endif // !defined(BOOST_VARIANT_DO_NOT_USE_VARIADIC_TEMPLATES)
#endif // !defined(BOOST_VARIANT_DETAIL_NO_SUBSTITUTE)
}} // namespace detail::variant