Feature #718
Add Tie
Status: | Approved | Start date: | 03/12/2014 | |
---|---|---|---|---|
Priority: | Normal | Due date: | ||
Assignee: | - | % Done: | 0% | |
Category: | - | Spent time: | - | |
Target version: | - |
Description
template <class A, class B>
struct Tie2
{
A& a;
B& b;
void operator=(const Tuple2<A, B>& s) { a = s.a; b = s.b; }
Tie2(A& a, B& b) : a(a), b(b) {}
};
template <class A, class B>
Tie2<A, B> Tie(A& a, B& b) { return Tie2<A, B>(a, b); }
CONSOLE_APP_MAIN {
// std::initializer_list<Tuple2<int, int>> l = { {1, 2}, {3, 4} };
// for(auto x: l)
// DDUMP;
Tuple2<int, int> x = MakeTuple(1, 2);
int a, b;
Tie(a, b) = x;
History
#1 Updated by Miroslav Fidler about 11 years ago
- Status changed from New to Approved