1 // 2004-09-23 Chris Jefferson <chris@bubblescope.net>
3 // Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009
4 // Free Software Foundation, Inc.
6 // This file is part of the GNU ISO C++ Library. This library is free
7 // software; you can redistribute it and/or modify it under the
8 // terms of the GNU General Public License as published by the
9 // Free Software Foundation; either version 3, or (at your option)
12 // This library is distributed in the hope that it will be useful,
13 // but WITHOUT ANY WARRANTY; without even the implied warranty of
14 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 // GNU General Public License for more details.
17 // You should have received a copy of the GNU General Public License along
18 // with this library; see the file COPYING3. If not see
19 // <http://www.gnu.org/licenses/>.
24 #include <testsuite_hooks.h>
26 using namespace std::tr1;
32 bool test __attribute__((unused)) = true;
37 // Test empty constructor
38 tuple<> ta __attribute__((unused));
40 // Test construction from values
41 tuple<int,int> tc(x1,x2);
42 tuple<int,int&> td(x1,x2);
43 tuple<const int&> te(z1);
46 VERIFY(get<0>(td) == 0 && get<1>(td) == 1 && get<0>(te) == 1);
48 // Test identical tuple copy constructor
49 tuple<int,int> tf(tc);
50 tuple<int,int> tg(td);
51 tuple<const int&> th(te);
52 // Test different tuple copy constructor
53 tuple<int,double> ti(tc);
54 tuple<int,double> tj(td);
55 //tuple<int&, int&> tk(tc);
56 tuple<const int&, const int&> tl(tc);
57 tuple<const int&, const int&> tm(tl);
58 // Test constructing from a pair
59 pair<int,int> pair1(1,1);
60 const pair<int,int> pair2(pair1);
61 tuple<int,int> tn(pair1);
62 tuple<int,const int&> to(pair1);
63 tuple<int,int> tp(pair2);
64 tuple<int,const int&> tq(pair2);