diff --git a/uppsrc/Core/Tuple.h b/uppsrc/Core/Tuple.h index 6c5530b2a..ad4c2b04d 100644 --- a/uppsrc/Core/Tuple.h +++ b/uppsrc/Core/Tuple.h @@ -97,27 +97,15 @@ struct TupleN<4, A, B, C, D> : public TupleN<3, A, B, C> #define GET_FROM_TUPLE(M, I) \ \ template \ -auto GetFromTuple(const T& t, const IndexI__&) -> const decltype(t.M)& \ +auto GetFromTuple(const T& t, const IndexI__&) -> decltype(t.M)& \ { \ - return t.M; \ + return const_cast(t).M; \ } \ \ template \ -auto GetFromTupleByType(const T& t, decltype(t.M)*, const IndexI__* = NULL) -> const decltype(t.M)& \ +auto GetFromTupleByType(const T& t, decltype(t.M)*, const IndexI__* = NULL) -> decltype(t.M)& \ { \ - return t.M; \ -} \ - \ -template \ -auto GetFromTuple(T& t, const IndexI__&) -> decltype(t.M)& \ -{ \ - return t.M; \ -} \ - \ -template \ -auto GetFromTupleByType(T& t, decltype(t.M)*, const IndexI__* = NULL) -> decltype(t.M)& \ -{ \ - return t.M; \ + return const_cast(t).M; \ } GET_FROM_TUPLE(a, 0)