mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-07-11 22:03:01 -06:00
Core: Workaround for MSC issue in Tuple
git-svn-id: svn://ultimatepp.org/upp/trunk@12431 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
parent
25f9185e64
commit
ef0e389181
1 changed files with 4 additions and 16 deletions
|
|
@ -97,27 +97,15 @@ struct TupleN<4, A, B, C, D> : public TupleN<3, A, B, C>
|
|||
#define GET_FROM_TUPLE(M, I) \
|
||||
\
|
||||
template <typename T> \
|
||||
auto GetFromTuple(const T& t, const IndexI__<I>&) -> const decltype(t.M)& \
|
||||
auto GetFromTuple(const T& t, const IndexI__<I>&) -> decltype(t.M)& \
|
||||
{ \
|
||||
return t.M; \
|
||||
return const_cast<T&>(t).M; \
|
||||
} \
|
||||
\
|
||||
template <typename T> \
|
||||
auto GetFromTupleByType(const T& t, decltype(t.M)*, const IndexI__<I>* = NULL) -> const decltype(t.M)& \
|
||||
auto GetFromTupleByType(const T& t, decltype(t.M)*, const IndexI__<I>* = NULL) -> decltype(t.M)& \
|
||||
{ \
|
||||
return t.M; \
|
||||
} \
|
||||
\
|
||||
template <typename T> \
|
||||
auto GetFromTuple(T& t, const IndexI__<I>&) -> decltype(t.M)& \
|
||||
{ \
|
||||
return t.M; \
|
||||
} \
|
||||
\
|
||||
template <typename T> \
|
||||
auto GetFromTupleByType(T& t, decltype(t.M)*, const IndexI__<I>* = NULL) -> decltype(t.M)& \
|
||||
{ \
|
||||
return t.M; \
|
||||
return const_cast<T&>(t).M; \
|
||||
}
|
||||
|
||||
GET_FROM_TUPLE(a, 0)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue