From f07c9220519193c5a9f7e835e45f8d01ec236023 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Thu, 5 Jul 2012 21:31:13 +0200 Subject: [PATCH] GCC 4.5 compatibility: worked around "Sorry, not implemented" error. SizeBasedCall is internally used only in MeshTools::compressIndices(), modified the function to not use variadic templates, only the one parameter used in compressIndices(). --- src/SizeTraits.h | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) 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: