/******************************************************************************* * This file is part of the "https://github.com/blackmatov/meta.hpp" * For conditions of distribution and use, see copyright notice in LICENSE.md * Copyright (C) 2021-2024, by Matvey Cherevko (blackmatov@gmail.com) ******************************************************************************/ #include #include namespace { namespace meta = meta_hpp; meta::scope sc; int inner(int a, int b) { return a + b; } struct A { A() = default; ~A() = default; A(const A&) { std::array args{1, 2}; v = sc.get_function("inner").invoke_variadic(args.begin(), args.end()).as(); } int v{}; }; int outer(A l, A r) { return l.v + r.v; } } TEST_CASE("meta/meta_issues/random/8") { sc = meta::local_scope_("") .function_("inner", &inner) .function_("outer", &outer); std::array args{}; CHECK(sc.get_function("outer").invoke_variadic(args.begin(), args.end()).as() == 6); }