diff --git a/include/boost/variant/detail/substitute.hpp b/include/boost/variant/detail/substitute.hpp index 08972d6..f9d29a5 100644 --- a/include/boost/variant/detail/substitute.hpp +++ b/include/boost/variant/detail/substitute.hpp @@ -166,7 +166,9 @@ private: typedef typename substitute< R, Dest, Source >::type r; public: - typedef r (*type)(A...); + typedef r (*type)(typename substitute< + A, Dest, Source + >::type...); }; #else diff --git a/test/issue42.cpp b/test/issue42.cpp index a8ce7ab..a7d8842 100644 --- a/test/issue42.cpp +++ b/test/issue42.cpp @@ -25,7 +25,8 @@ typedef std::shared_ptr ptr_t; #endif - +template +class func{}; int main() { typedef boost::make_recursive_variant< @@ -36,6 +37,7 @@ int main() { node x = 1; (void)x; + typedef boost::make_recursive_variant< std::string, int, double, bool, ptr_t, @@ -45,4 +47,15 @@ int main() { node2 x2 = 1; (void)x2; + + + typedef boost::make_recursive_variant< + int, + func, + boost::recursive_variant_&(*)(boost::recursive_variant_, boost::recursive_variant_*), + ptr_t + >::type node3; + + node3 x3 = func(); + (void)x3; }