diff options
Diffstat (limited to 'src/libaudcore/templates.h')
-rw-r--r-- | src/libaudcore/templates.h | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/libaudcore/templates.h b/src/libaudcore/templates.h index 1a78251..e78aea0 100644 --- a/src/libaudcore/templates.h +++ b/src/libaudcore/templates.h @@ -24,10 +24,10 @@ #include <type_traits> #include <utility> -#ifdef _WIN32 +// #undef POSIX and Windows macros to avoid name conflicts +#undef abs #undef min #undef max -#endif namespace aud { @@ -110,6 +110,13 @@ struct array constexpr array (Args && ... args) : vals { static_cast<Args &&> (args) ...} {} + // Due to GCC bug #63707, the forwarding constructor given above cannot be + // used to initialize the array when V is a class with no copy constructor. + // As a very limited workaround, provide a second constructor which can be + // used to initialize the array to default values in this case. + constexpr array () : + vals () {} + constexpr const V & operator[] (T t) const { return vals[(int) t]; } constexpr const V * begin () const |