32#if !defined (_RWSTD_NO_EXT_CXX_0X) \
33 && !defined (_RWSTD_NO_RVALUE_REFERENCES)
46#define DBL_VAL 3.14159
47#define PTR_VAL ptr_val
48#define USER_VAL user_val
53typedef std::tuple<bool, char, int, double, void*, UserDefined>
Tuple;
56test_const_get (
const Tuple&
t)
58 rw_info (0, __FILE__, __LINE__,
"get (const)");
60 const bool&
b = std::get<0> (
t);
62 "expected %s",
b?
"true":
"false",
BOOL_VAL?
"true":
"false");
64 const char&
c = std::get<1> (
t);
66 "get<1>(t), got \'%c\', expected \'%c\'",
c,
CHAR_VAL);
68 const int&
i = std::get<2> (
t);
70 "get<2>(t), got %d, expected %d",
i,
INT_VAL);
72 const double&
d = std::get<3> (
t);
74 "get<3>(t), got %f, expected %f",
d,
DBL_VAL);
76 void*
const&
p = std::get<4> (
t);
78 "get<4>(t), got %p, expected %p",
p,
PTR_VAL);
82 "get<5>(t), got %d, expected %d",
91 rw_info (0, __FILE__, __LINE__,
"get");
93 bool&
b = std::get<0> (
t);
95 "get<0>(t), got %d, expected %b",
b,
BOOL_VAL);
98 "get<0>(t), got %d, expected %b", std::get<0> (
t),
101 char&
c = std::get<1> (
t);
103 "get<1>(t), got %c, expected \'%c\'",
c,
CHAR_VAL);
105 rw_assert (std::get<1> (
t) ==
'1', __FILE__, __LINE__,
106 "get<1>(t), got %c, expected \'1\'", std::get<1> (
t));
108 int&
i = std::get<2> (
t);
110 "get<2>(t), got %d, expected %d",
i,
INT_VAL);
113 "get<1>(t), got %d, expected %d", std::get<2> (
t),
116 double&
d = std::get<3> (
t);
118 "get<3>(t), got %f, expected %f",
d,
DBL_VAL);
122 "get<3>(t), got %f, expected %f", std::get<3> (
t),
125 void*
p = std::get<4> (
t);
127 "get<4>(t), got %p, expected %p",
p,
PTR_VAL);
129 rw_assert (std::get<4> (
t) == &
d, __FILE__, __LINE__,
130 "get<4>(t), got %p, expected %p", std::get<4> (
t), &
d);
134 "get<5>(t), got %d, expected %d",
138 "get<5>(t), got %d, expected %d",
147 ptr_val =
static_cast<void*
> (argv [0]);
162#if defined (_RWSTD_NO_EXT_CXX_0X)
165 "test disabled because _RWSTD_NO_EXT_CXX_0X is defined");
167#elif defined (_RWSTD_NO_RVALUE_REFERENCES)
170 "test disabled because _RWSTD_NO_RVALUE_REFERENCES is "
183 return rw_test (argc, argv, __FILE__,
184 "[tuple.elem]",
"20.3.1.5 Element access",
std::tuple< bool, char, int, double, void *, UserDefined > Tuple
void run_test(const ForwardIterator &dummy, T *, Predicate *pred)
void test_get(FileStream &f, const char *type, const CharT array[], std::size_t)
_TEST_EXPORT int rw_test(int argc, char *argv[], const char *filename, const char *clause, const char *comment, int(*testfun)(int, char **), const char *optspec,...)
_TEST_EXPORT int rw_info(int, const char *, int, const char *,...)
_TEST_EXPORT int rw_assert(int, const char *, int, const char *,...)
_TEST_EXPORT int rw_warn(int, const char *, int, const char *,...)
_TEST_EXPORT int rw_dblcmp(double x, double y)