File tree Expand file tree Collapse file tree 2 files changed +8
-8
lines changed
Expand file tree Collapse file tree 2 files changed +8
-8
lines changed Original file line number Diff line number Diff line change 11#include < testthat.h>
22
33// Helper to initialize Rcomplex portably across compilers
4- // Modern compilers prefer {{r,i}} but older compilers don't support it
4+ // Modern compilers with C++17+ prefer {{r,i}} but older standards don't support it
55#if (defined(_WIN32) && defined(__GNUC__) && !defined(__clang__)) || \
6- (defined (__GNUC__) && !defined (__clang__) && __GNUC__ < 8 )
7- // MinGW on Windows or older GCC - use direct member initialization with different param names
6+ (defined (__GNUC__) && !defined (__clang__) && __cplusplus < 201703L )
7+ // MinGW on Windows or pre-C++17 - use direct member initialization with different param names
88 #define MAKE_RCOMPLEX (real, imag ) []() { Rcomplex c; c.r = (real); c.i = (imag); return c; }()
99#else
10- // Modern compilers - use aggregate initialization
10+ // Modern compilers with C++17+ - use aggregate initialization
1111 #define MAKE_RCOMPLEX (r, i ) Rcomplex{{r, i}}
1212#endif
1313
Original file line number Diff line number Diff line change 11#include < testthat.h>
22
33// Helper to initialize Rcomplex portably across compilers
4- // Modern compilers prefer {{r,i}} but older compilers don't support it
4+ // Modern compilers with C++17+ prefer {{r,i}} but older standards don't support it
55#if (defined(_WIN32) && defined(__GNUC__) && !defined(__clang__)) || \
6- (defined (__GNUC__) && !defined (__clang__) && __GNUC__ < 8 )
7- // MinGW on Windows or older GCC - use direct member initialization with different param names
6+ (defined (__GNUC__) && !defined (__clang__) && __cplusplus < 201703L )
7+ // MinGW on Windows or pre-C++17 - use direct member initialization with different param names
88 #define MAKE_RCOMPLEX (real, imag ) []() { Rcomplex c; c.r = (real); c.i = (imag); return c; }()
99#else
10- // Modern compilers - use aggregate initialization
10+ // Modern compilers with C++17+ - use aggregate initialization
1111 #define MAKE_RCOMPLEX (r, i ) Rcomplex{{r, i}}
1212#endif
1313
You can’t perform that action at this time.
0 commit comments