@@ -458,6 +458,23 @@ class out {
458
458
//
459
459
// -----------------------------------------------------------------------
460
460
//
461
+
462
+ // --------------------------------------------------------------------
463
+ // TODO: When MSVC supports __VA_OPT__ in standard mode without the
464
+ // experimental /Zc:preprocessor switch, use this single macro
465
+ // instead of the dual macros below that special-case _0 args
466
+ // AND: Make the similarly noted change in cppfront.cpp
467
+ //
468
+ // #define CPP2_UFCS(FUNCNAME,PARAM1,...) \
469
+ //[](auto&& obj __VA_OPT__(, auto&& ...params) ) { \
470
+ // if constexpr (requires{ std::forward<decltype(obj)>(obj).FUNCNAME(__VA_OPT__(std::forward<decltype(params)>(params)...)); }) { \
471
+ // return std::forward<decltype(obj)>(obj).FUNCNAME(__VA_OPT__(std::forward<decltype(params)>(params)...)); \
472
+ // } else { \
473
+ // return FUNCNAME(std::forward<decltype(obj)>(obj) __VA_OPT__(, std::forward<decltype(params)>(params)...)); \
474
+ // } \
475
+ //}(PARAM1 __VA_OPT__(, __VA_ARGS__) )
476
+
477
+
461
478
#define CPP2_UFCS (FUNCNAME,PARAM1,...) \
462
479
[](auto && obj, auto && ...params) { \
463
480
if constexpr (requires { std::forward<decltype (obj)>(obj).FUNCNAME (std::forward<decltype (params)>(params)...); }) { \
@@ -475,6 +492,7 @@ class out {
475
492
return FUNCNAME (std::forward<decltype (obj)>(obj)); \
476
493
} \
477
494
}(PARAM1)
495
+ // --------------------------------------------------------------------
478
496
479
497
480
498
// -----------------------------------------------------------------------
0 commit comments