From 6313a7964ad8a00bd44103fb06bdced4527e03c9 Mon Sep 17 00:00:00 2001 From: Jean-Louis Leroy Date: Sun, 22 Sep 2024 15:04:08 -0400 Subject: [PATCH] more macro work --- dev/presetgen | 2 + docs.in/reference/YOMM2_SYMBOL.cpp | 10 +- docs.in/reference/method.cpp | 6 +- docs.in/reference/method_container.cpp | 6 +- docs.in/reference/use_definitions.cpp | 4 +- docs.in/tutorials/api.cpp | 6 +- docs.in/tutorials/templates_tutorial.cpp | 20 ++-- examples/containers/arc_painter.cpp | 2 +- examples/containers/painter.hpp | 8 +- examples/containers/segment_painter.cpp | 6 +- include/yorel/yomm2/core.hpp | 1 + include/yorel/yomm2/macros.hpp | 135 +++++++---------------- include/yorel/yomm2/symbols.hpp | 4 +- tests/benchmark_rdtsc.cpp | 6 +- tests/test_blackbox.cpp | 6 +- tests/test_member_method.cpp | 4 +- tests/test_virtual_ptr_all.cpp | 14 +-- tests/test_virtual_ptr_basic.cpp | 16 +-- 18 files changed, 102 insertions(+), 154 deletions(-) diff --git a/dev/presetgen b/dev/presetgen index 922b45b2..fd5df881 100755 --- a/dev/presetgen +++ b/dev/presetgen @@ -52,6 +52,8 @@ presets = { "YOMM2_ENABLE_EXAMPLES": "ON", "YOMM2_ENABLE_TESTS": "ON", "YOMM2_ENABLE_BENCHMARKS": "ON", + "VCPKG_INSTALL_OPTIONS": "--allow-unsupported" + }, **tool_chain.configure_presets, } diff --git a/docs.in/reference/YOMM2_SYMBOL.cpp b/docs.in/reference/YOMM2_SYMBOL.cpp index f4f0996e..282a776b 100644 --- a/docs.in/reference/YOMM2_SYMBOL.cpp +++ b/docs.in/reference/YOMM2_SYMBOL.cpp @@ -1,13 +1,13 @@ #ifdef YOMM2_MD -macro: YOMM2_SYMBOL +macro: YOMM2_NAME headers: yorel/yomm2/symbols.hpp, yorel/yomm2.hpp ```c++ -#define YOMM2_SYMBOL(seed) /*unspecified*/ +#define YOMM2_NAME(seed) /*unspecified*/ ``` -Macro `YOMM2_SYMBOL` expands to an obfuscated symbol, unlikely +Macro `YOMM2_NAME` expands to an obfuscated symbol, unlikely to clash with other names in scope. ## Example @@ -23,9 +23,9 @@ to clash with other names in scope. BOOST_AUTO_TEST_CASE(ref_example) { int foo = 1; - int YOMM2_SYMBOL(foo) = 2; + int YOMM2_NAME(foo) = 2; BOOST_TEST(foo == 1); - BOOST_TEST(YOMM2_SYMBOL(foo) == 2); + BOOST_TEST(YOMM2_NAME(foo) == 2); } #endif diff --git a/docs.in/reference/method.cpp b/docs.in/reference/method.cpp index 670469e1..c3056b93 100644 --- a/docs.in/reference/method.cpp +++ b/docs.in/reference/method.cpp @@ -23,7 +23,7 @@ and [`method::override`](#override) class templates. * **Name**: a type that differentiates methods with the same signature. It is recommended to declare a class (there is no need to define it) for each method -name in the same namespace. ->YOMM2_SYMBOL can be used for that effect. +name in the same namespace. ->YOMM2_NAME can be used for that effect. * **ReturnType**: the type of the value returned by the function, or void. May not be `auto`. @@ -205,8 +205,8 @@ struct kick_bulldog : kick::with_next { }; YOMM2_STATIC(kick::override); -struct YOMM2_SYMBOL(pet); // use obfuscated name -using pet = yomm2::method), std::string>; +struct YOMM2_NAME(pet); // use obfuscated name +using pet = yomm2::method), std::string>; std::string pet_cat(Cat& dog) { return "purr"; } YOMM2_STATIC(pet::override_fn); diff --git a/docs.in/reference/method_container.cpp b/docs.in/reference/method_container.cpp index 143a2359..ce799396 100644 --- a/docs.in/reference/method_container.cpp +++ b/docs.in/reference/method_container.cpp @@ -42,7 +42,7 @@ the same namespace as the container itself. #include #include -template struct kicks; +template struct kicks; class Animal { std::string name; @@ -53,7 +53,7 @@ class Animal { virtual ~Animal() { } - template friend struct kicks; + template friend struct kicks; }; class Dog : public Animal { @@ -73,7 +73,7 @@ define_method_inline(kicks, kick, (Dog * dog), std::string) { } define_method_in(kicks, kick, (Bulldog * dog), std::string) { - return kicks::fn(dog) + " and bites"; + return kicks::fn(dog) + " and bites"; } BOOST_AUTO_TEST_CASE(ref_example) { diff --git a/docs.in/reference/use_definitions.cpp b/docs.in/reference/use_definitions.cpp index 949edb4e..faa39e82 100644 --- a/docs.in/reference/use_definitions.cpp +++ b/docs.in/reference/use_definitions.cpp @@ -43,8 +43,8 @@ using boost::mp11::mp_list; use_classes YOMM2_GENSYM; -struct YOMM2_SYMBOL(same_type); -using same_type = method, virtual_), bool>; // 1 - see notes below diff --git a/docs.in/tutorials/api.cpp b/docs.in/tutorials/api.cpp index 1a4cdd20..f9966ef3 100644 --- a/docs.in/tutorials/api.cpp +++ b/docs.in/tutorials/api.cpp @@ -190,7 +190,7 @@ BOOST_AUTO_TEST_CASE(test_synopsis_functions_no_macros) { // - `YOMM2_STATIC(...)` expands to `static __VA_ARGS__ YOMM2_GENSYM`, i.e. it // creates a static object of the type specified as macro parameters. -// - `YOMM2_SYMBOL(name)` expands to an obfuscated version of `name`. It is used +// - `YOMM2_NAME(name)` expands to an obfuscated version of `name`. It is used // for the method key and the guide function. // In addition, the header provides @@ -241,9 +241,9 @@ using namespace yorel::yomm2; YOMM2_STATIC(use_classes); -struct YOMM2_SYMBOL(kick); +struct YOMM2_NAME(kick); -using kick = method), std::string>; +using kick = method), std::string>; // > diff --git a/docs.in/tutorials/templates_tutorial.cpp b/docs.in/tutorials/templates_tutorial.cpp index 5ca12340..378b0564 100644 --- a/docs.in/tutorials/templates_tutorial.cpp +++ b/docs.in/tutorials/templates_tutorial.cpp @@ -232,26 +232,26 @@ vector reals(new concrete_vector{4., 5., 6.}); using namespace yorel::yomm2; -struct YOMM2_SYMBOL(addition); +struct YOMM2_NAME(addition); using addition = method< - YOMM2_SYMBOL(addition)( + YOMM2_NAME(addition)( virtual_, virtual_), vector>; -struct YOMM2_SYMBOL(subtraction); +struct YOMM2_NAME(subtraction); using subtraction = method< - YOMM2_SYMBOL(subtraction)( + YOMM2_NAME(subtraction)( virtual_, virtual_), vector>; -struct YOMM2_SYMBOL(comparison); +struct YOMM2_NAME(comparison); using comparison = method< - YOMM2_SYMBOL(comparison)( + YOMM2_NAME(comparison)( virtual_, virtual_), bool>; @@ -882,11 +882,11 @@ BOOST_AUTO_TEST_CASE(test_static_operations) { // code< -struct YOMM2_SYMBOL(transpose); +struct YOMM2_NAME(transpose); template using transpose = - method), handle>; + method), handle>; template< template typename Matrix, typename T, @@ -1134,11 +1134,11 @@ static_assert( // code< -struct YOMM2_SYMBOL(add); +struct YOMM2_NAME(add); template using add = method< - YOMM2_SYMBOL(add)(virtual_, virtual_), + YOMM2_NAME(add)(virtual_, virtual_), handle>>; template< diff --git a/examples/containers/arc_painter.cpp b/examples/containers/arc_painter.cpp index 7e3fae03..6e49a78e 100644 --- a/examples/containers/arc_painter.cpp +++ b/examples/containers/arc_painter.cpp @@ -23,7 +23,7 @@ define_method_in( painters, paintObject, (Painter & painter, const geometries::Arc& arc), void) { ++painter.counter; - painters::fn(painter, arc); + next(painter, arc); std::cout << " " << "painting arc\n"; } diff --git a/examples/containers/painter.hpp b/examples/containers/painter.hpp index f71cca97..66c6e084 100644 --- a/examples/containers/painter.hpp +++ b/examples/containers/painter.hpp @@ -16,10 +16,10 @@ namespace painter { namespace paint1d { -template struct painters; +template struct painters; } namespace paint2d { -template struct painters; +template struct painters; } class Painter; @@ -36,8 +36,8 @@ class Painter { private: int counter = 0; - template friend struct paint1d::painters; - friend paint2d::painters; + template friend struct paint1d::painters; + friend paint2d::painters; }; inline void Painter::paint(const geometries::Geometry& geometry) { diff --git a/examples/containers/segment_painter.cpp b/examples/containers/segment_painter.cpp index 52735757..f2d4cb7b 100644 --- a/examples/containers/segment_painter.cpp +++ b/examples/containers/segment_painter.cpp @@ -23,9 +23,9 @@ define_method_in( painters, paintObject, (Painter & painter, const geometries::Segment& segment), void) { ++painter.counter; - painters::fn(painter, segment); - std::cout << " " - << "painting segment\n"; + painters::fn( + painter, segment); + std::cout << " " << "painting segment\n"; } } // namespace paint1d diff --git a/include/yorel/yomm2/core.hpp b/include/yorel/yomm2/core.hpp index ec8c809d..15ca4cad 100644 --- a/include/yorel/yomm2/core.hpp +++ b/include/yorel/yomm2/core.hpp @@ -696,6 +696,7 @@ class method public: // Public aliases. + using name_type = Name; using return_type = Return; using next_type = Return (*)(detail::remove_virtual...) noexcept(NoExcept); diff --git a/include/yorel/yomm2/macros.hpp b/include/yorel/yomm2/macros.hpp index 775408ca..043ce9da 100644 --- a/include/yorel/yomm2/macros.hpp +++ b/include/yorel/yomm2/macros.hpp @@ -37,117 +37,62 @@ #define yOMM2_WHEN_STATIC(CODE1, CODE2) CODE1 #define yOMM2_WHEN_NOT_STATIC(CODE1, CODE2) CODE2 -// Find method given the arguments. We cannot detect if __VAR_ARGS__ is empty, -// so we cannot express the 'method<...>' type directly. Instead, we wrap -// __VAR_ARGS__ in 'types<...>' and use 'method_va_args_first' find the method. - -#define yOMM2_method(NAME, ARGS, ...) \ - ::yorel::yomm2::method - #define YOMM2_DECLARE(NAME, ARGS, ...) \ - yOMM2_DECLARE(yOMM2_WHEN_NOT_STATIC, NAME, ARGS, __VA_ARGS__) + YOREL_YOMM2_DETAIL_DECLARE(yOMM2_WHEN_NOT_STATIC, NAME, ARGS, __VA_ARGS__) #define YOMM2_STATIC_DECLARE(NAME, ARGS, ...) \ - yOMM2_DECLARE(yOMM2_WHEN_STATIC, NAME, ARGS, __VA_ARGS__) + YOREL_YOMM2_DETAIL_DECLARE(yOMM2_WHEN_STATIC, NAME, ARGS, __VA_ARGS__) -#define yOMM2_DECLARE(IF_STATIC, NAME, ARGS, ...) \ - struct YOMM2_SYMBOL(NAME); \ +#define YOREL_YOMM2_DETAIL_DECLARE(IF_STATIC, NAME, ARGS, ...) \ + struct YOMM2_NAME(NAME); \ IF_STATIC(static, ) \ - yOMM2_method(NAME, ARGS, __VA_ARGS__) NAME##_yomm2_guide( \ - BOOST_PP_REPEAT(BOOST_PP_TUPLE_SIZE(ARGS), yOMM2_PLIST, ARGS)); \ + ::yorel::yomm2::method \ + BOOST_PP_CAT(YOMM2_NAME(NAME), _yorel_yomm2_guide)( \ + BOOST_PP_REPEAT(BOOST_PP_TUPLE_SIZE(ARGS), yOMM2_PLIST, ARGS)); \ IF_STATIC(static, ) \ inline decltype(auto) NAME( \ BOOST_PP_REPEAT(BOOST_PP_TUPLE_SIZE(ARGS), yOMM2_PLIST, ARGS)) { \ - return yOMM2_method(NAME, ARGS, __VA_ARGS__)::fn( \ + return ::yorel::yomm2::method::fn( \ BOOST_PP_REPEAT(BOOST_PP_TUPLE_SIZE(ARGS), yOMM2_ALIST, ARGS)); \ } -#define YOMM2_DEFINE_IN(CONTAINER, NAME, ARGS, ...) \ - yOMM2_DEFINE_IN_CONTAINER( \ - YOMM2_GENSYM, , CONTAINER, NAME, ARGS, __VA_ARGS__) - -#define yOMM2_SELECT_METHOD(NAME, ARGS) \ +#define YOREL_YOMM2_DETAIL_LOCATE_METHOD(NAME, ARGS) \ template \ - struct _yOMM2_select; \ + struct yorel_yomm2_detail_locate_method_aux; \ template \ - struct _yOMM2_select { \ - using type = decltype(NAME##_yomm2_guide(std::declval()...)); \ + struct yorel_yomm2_detail_locate_method_aux { \ + using type = decltype(NAME##_yorel_yomm2_guide(std::declval()...)); \ }; \ - using method_type = _yOMM2_select::type; \ - using _yOMM2_return_t = method_type::return_type; + using method_type = yorel_yomm2_detail_locate_method_aux::type; -#define YOMM2_DEFINE(NAME, ARGS, ...) \ - yOMM2_DEFINE(YOMM2_GENSYM, NAME, ARGS, __VA_ARGS__) - -#define yOMM2_DEFINE(NS, NAME, ARGS, ...) \ - namespace { \ - namespace NS { \ - yOMM2_SELECT_METHOD(NAME, ARGS); \ - method_type::next_type next; \ - struct _yOMM2_spec { \ - static boost::mp11::mp_first> \ - yOMM2_body ARGS; \ - }; \ - method_type::override_fn<_yOMM2_spec::yOMM2_body> YOMM2_GENSYM(&next); \ - } \ - } \ - boost::mp11::mp_first> \ - NS::_yOMM2_spec::yOMM2_body ARGS - -#define YOMM2_DEFINE_INLINE(CONTAINER, NAME, ARGS, ...) \ - yOMM2_DEFINE_IN_CONTAINER( \ - YOMM2_GENSYM, inline, CONTAINER, NAME, ARGS, __VA_ARGS__) - -#define yOMM2_DEFINE_IN_CONTAINER(NS, INLINE, CONTAINER, NAME, ARGS, ...) \ - template \ - struct CONTAINER; \ - namespace { \ - namespace NS { \ - yOMM2_SELECT_METHOD(NAME, ARGS); \ - } \ - } \ +#define YOREL_YOMM2_DETAIL_DEFINE(INLINE, OVERRIDERS, NAME, ARGS, ...) \ + template \ + struct OVERRIDERS; \ template<> \ - struct CONTAINER< \ - boost::mp11::mp_first> ARGS> { \ - static NS::method_type::next_type next; \ - static boost::mp11::mp_first> fn \ + struct OVERRIDERS { \ + YOREL_YOMM2_DETAIL_LOCATE_METHOD(NAME, ARGS); \ + static method_type::next_type next; \ + static boost::mp11::mp_back> fn \ ARGS; \ }; \ - INLINE NS::method_type::next_type CONTAINER< \ - boost::mp11::mp_first> ARGS>::next; \ - namespace { \ - namespace NS { \ - INLINE method_type::override_fn> ARGS>::fn> \ - YOMM2_GENSYM( \ - &CONTAINER< \ - boost::mp11::mp_first> \ - ARGS>::next); \ - } \ - } \ - INLINE boost::mp11::mp_first> CONTAINER< \ - boost::mp11::mp_first> ARGS>::fn \ - ARGS - -// #if !BOOST_PP_VARIADICS_MSVC -// #define YOMM2_FRIEND(...) \ -// BOOST_PP_OVERLOAD(YOMM2_FRIEND_, __VA_ARGS__)(__VA_ARGS__) -// #else -// #define YOMM2_FRIEND(...) \ -// BOOST_PP_CAT( \ -// BOOST_PP_OVERLOAD(YOMM2_FRIEND_, __VA_ARGS__)(__VA_ARGS__), \ -// BOOST_PP_EMPTY()) -// #endif - -// #define YOMM2_FRIEND_1(CONTAINER) \ -// template \ -// friend struct CONTAINER - -// #define YOMM2_FRIEND_3(CONTAINER, ...) \ -// friend struct CONTAINER<__VA_ARGS__> - -// #define YOMM2_DEFINITION(CONTAINER, NAME, ARGS) \ -// CONTAINER::fn + INLINE OVERRIDERS::method_type::next_type \ + OVERRIDERS::next; \ + INLINE YOMM2_STATIC( \ + OVERRIDERS::method_type::override>); \ + INLINE auto OVERRIDERS::fn ARGS \ + ->boost::mp11::mp_back> + +#define YOMM2_DEFINE_IN(OVERRIDERS, NAME, ARGS, ...) \ + YOREL_YOMM2_DETAIL_DEFINE( \ + , OVERRIDERS, YOMM2_NAME(NAME), ARGS, __VA_ARGS__) + +#define YOMM2_DEFINE_INLINE(OVERRIDERS, NAME, ARGS, ...) \ + YOREL_YOMM2_DETAIL_DEFINE( \ + inline, OVERRIDERS, YOMM2_NAME(NAME), ARGS, __VA_ARGS__) + +#define YOMM2_DEFINE(NAME, ARGS, ...) \ + YOREL_YOMM2_DETAIL_DEFINE( \ + , yorel_yomm2_overriders, YOMM2_NAME(NAME), ARGS, __VA_ARGS__) #define YOMM2_CLASSES(...) \ static ::yorel::yomm2::detail::use_classes_macro< \ @@ -155,7 +100,7 @@ YOMM2_GENSYM; #define YOMM2_METHOD_CLASS(NAME, ARGS, ...) \ - ::yorel::yomm2::method + ::yorel::yomm2::method #define register_classes YOMM2_CLASSES @@ -166,7 +111,7 @@ #define define_method_inline YOMM2_DEFINE_INLINE #define method_class YOMM2_METHOD_CLASS -#define method_container YOMM2_DECLARE_METHOD_CONTAINER +#define method_OVERRIDERS YOMM2_DECLARE_METHOD_OVERRIDERS #define friend_method YOMM2_FRIEND #define method_definition YOMM2_DEFINITION diff --git a/include/yorel/yomm2/symbols.hpp b/include/yorel/yomm2/symbols.hpp index 16b215d9..9cda3380 100644 --- a/include/yorel/yomm2/symbols.hpp +++ b/include/yorel/yomm2/symbols.hpp @@ -4,10 +4,10 @@ #include -#define YOMM2_GENSYM BOOST_PP_CAT(YoMm2_gS_, __COUNTER__) +#define YOMM2_GENSYM BOOST_PP_CAT(yomm2_gensym_, __COUNTER__) #define YOMM2_STATIC(...) static __VA_ARGS__ YOMM2_GENSYM -#define YOMM2_SYMBOL(ID) BOOST_PP_CAT(YoMm2_S_, ID) +#define YOMM2_NAME(NAME) NAME##_yorel_yomm2 #endif diff --git a/tests/benchmark_rdtsc.cpp b/tests/benchmark_rdtsc.cpp index 7248068e..659386b8 100644 --- a/tests/benchmark_rdtsc.cpp +++ b/tests/benchmark_rdtsc.cpp @@ -62,9 +62,9 @@ struct Cat : Animal { void pet_vf() override { /*purr*/ }; }; -struct YOMM2_SYMBOL(pet_ref); -struct YOMM2_SYMBOL(pet_vp); -struct YOMM2_SYMBOL(pet_iptr); +struct YOMM2_NAME(pet_ref); +struct YOMM2_NAME(pet_vp); +struct YOMM2_NAME(pet_iptr); } // namespace stat diff --git a/tests/test_blackbox.cpp b/tests/test_blackbox.cpp index 99deae60..29408bc9 100644 --- a/tests/test_blackbox.cpp +++ b/tests/test_blackbox.cpp @@ -215,8 +215,8 @@ struct Bulldog : Dog {}; register_classes(Animal, Dog, Bulldog); -struct YOMM2_SYMBOL(kick); -using kick = method), std::string>; +struct YOMM2_NAME(kick); +using kick = method), std::string>; std::string kick_dog(Dog& dog) { return "bark"; @@ -328,7 +328,7 @@ class Dog : public animals::Animal {}; YOMM2_CLASSES(Dog, animals::Animal); -YOMM2_DEFINE(kick, (const Dog& dog), std::string) { +YOMM2_DEFINE(animals::kick, (const Dog& dog), std::string) { return "bark"; } diff --git a/tests/test_member_method.cpp b/tests/test_member_method.cpp index e051b2a1..a408be53 100644 --- a/tests/test_member_method.cpp +++ b/tests/test_member_method.cpp @@ -32,9 +32,9 @@ struct Payroll { } private: - struct YOMM2_SYMBOL(pay); + struct YOMM2_NAME(pay); using pay_method = - method), void>; + method), void>; void pay_employee(const Employee&) { balance -= 2000; diff --git a/tests/test_virtual_ptr_all.cpp b/tests/test_virtual_ptr_all.cpp index 8ec43fd9..e7f0ed0c 100644 --- a/tests/test_virtual_ptr_all.cpp +++ b/tests/test_virtual_ptr_all.cpp @@ -59,8 +59,8 @@ struct indirect_test_policy : test_policy_ { template using policy_types = types, indirect_test_policy>; -struct YOMM2_SYMBOL(kick); -struct YOMM2_SYMBOL(fight); +struct YOMM2_NAME(kick); +struct YOMM2_NAME(fight); namespace YOMM2_GENSYM { @@ -70,7 +70,7 @@ BOOST_AUTO_TEST_CASE_TEMPLATE( static use_classes YOMM2_GENSYM; using kick = method< - YOMM2_SYMBOL(kick)(virtual_ptr), std::string, Policy>; + YOMM2_NAME(kick)(virtual_ptr), std::string, Policy>; static typename kick::template override_fn< kick_bear>> YOMM2_GENSYM; @@ -127,13 +127,13 @@ BOOST_AUTO_TEST_CASE_TEMPLATE( static use_classes YOMM2_GENSYM; using kick = method< - YOMM2_SYMBOL(kick)(virtual_ptr), std::string, Policy>; + YOMM2_NAME(kick)(virtual_ptr), std::string, Policy>; static typename kick::template override_fn< kick_bear>> YOMM2_GENSYM; using fight = method< - YOMM2_SYMBOL(fight)( + YOMM2_NAME(fight)( virtual_ptr, virtual_ptr, virtual_ptr), std::string, Policy>; @@ -175,7 +175,7 @@ BOOST_AUTO_TEST_CASE_TEMPLATE( static use_classes YOMM2_GENSYM; using kick = method< - YOMM2_SYMBOL(kick)(virtual_shared_ptr), std::string, + YOMM2_NAME(kick)(virtual_shared_ptr), std::string, Policy>; static typename kick::template override_fn< @@ -183,7 +183,7 @@ BOOST_AUTO_TEST_CASE_TEMPLATE( YOMM2_GENSYM; using fight = method< - YOMM2_SYMBOL(fight)( + YOMM2_NAME(fight)( virtual_shared_ptr, virtual_shared_ptr, virtual_shared_ptr), diff --git a/tests/test_virtual_ptr_basic.cpp b/tests/test_virtual_ptr_basic.cpp index b0fa1de5..1571bc24 100644 --- a/tests/test_virtual_ptr_basic.cpp +++ b/tests/test_virtual_ptr_basic.cpp @@ -76,8 +76,8 @@ void kick_dog(virtual_ptr, std::ostream& os) { os << "bark"; } -struct YOMM2_SYMBOL(kick); -using kick = method, std::ostream&), void>; +struct YOMM2_NAME(kick); +using kick = method, std::ostream&), void>; YOMM2_STATIC(kick::override_fn); BOOST_AUTO_TEST_CASE(test_virtual_ptr_by_ref) { @@ -153,9 +153,9 @@ void kick_dog(virtual_shared_ptr, std::ostream& os) { os << "bark"; } -struct YOMM2_SYMBOL(kick); +struct YOMM2_NAME(kick); using kick = - method, std::ostream&), void>; + method, std::ostream&), void>; YOMM2_STATIC(kick::override_fn); BOOST_AUTO_TEST_CASE(test_virtual_shared_by_value) { @@ -176,9 +176,9 @@ void kick_dog(const virtual_shared_ptr&, std::ostream& os) { os << "bark"; } -struct YOMM2_SYMBOL(kick); +struct YOMM2_NAME(kick); using kick = - method&, std::ostream&), void>; + method&, std::ostream&), void>; YOMM2_STATIC(kick::override_fn); BOOST_AUTO_TEST_CASE(test_virtual_shared_by_const_reference) { @@ -206,8 +206,8 @@ void kick_dog(virtual_ptr, std::ostream& os) { os << "bark"; } -struct YOMM2_SYMBOL(kick); -using kick = method, std::ostream&), void>; +struct YOMM2_NAME(kick); +using kick = method, std::ostream&), void>; YOMM2_STATIC(kick::override_fn); BOOST_AUTO_TEST_CASE(test_virtual_ptr_non_polymorphic) {