2
0
mirror of https://github.com/boostorg/variant.git synced 2026-01-19 04:42:16 +00:00

Do substitute function arguments on compilers with variadic templates support (more fixes for the #42)

This commit is contained in:
Antony Polukhin
2018-02-21 23:10:25 +03:00
parent b8149a3a77
commit 98b5d42e6d
2 changed files with 17 additions and 2 deletions

View File

@@ -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

View File

@@ -25,7 +25,8 @@
typedef std::shared_ptr<boost::recursive_variant_> ptr_t;
#endif
template <class F>
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_&, const boost::recursive_variant_&)>,
boost::recursive_variant_&(*)(boost::recursive_variant_, boost::recursive_variant_*),
ptr_t
>::type node3;
node3 x3 = func<node3(*)(node3&, const node3&)>();
(void)x3;
}