diff --git a/src/SizeTraits.h b/src/SizeTraits.h index dfa19ec28..3842f2c37 100644 --- a/src/SizeTraits.h +++ b/src/SizeTraits.h @@ -117,19 +117,39 @@ template struct SizeBasedCall: public Base { * is no suitable type for indexing given data size, prints message to * error output and returns default-constructed value. */ + #ifndef MAGNUM_GCC45_COMPATIBILITY template auto operator()(Args&&... arguments) -> decltype(Base::template run(std::forward(arguments)...)) { + #else + template auto operator()(Args&& arguments) -> decltype(Base::template run(std::forward(arguments))) { + #endif switch(Math::log(256, size)) { case 0: + #ifndef MAGNUM_GCC45_COMPATIBILITY return Base::template run(std::forward(arguments)...); + #else + return Base::template run(std::forward(arguments)); + #endif case 1: + #ifndef MAGNUM_GCC45_COMPATIBILITY return Base::template run(std::forward(arguments)...); + #else + return Base::template run(std::forward(arguments)); + #endif case 2: case 3: + #ifndef MAGNUM_GCC45_COMPATIBILITY return Base::template run(std::forward(arguments)...); + #else + return Base::template run(std::forward(arguments)); + #endif } Error() << "SizeBasedCall: no type able to index" << size << "elements."; + #ifndef MAGNUM_GCC45_COMPATIBILITY return decltype(Base::template run(std::forward(arguments)...))(); + #else + return decltype(Base::template run(std::forward(arguments)))(); + #endif } private: