46bool less<Y>::operator() (
const Y &
a,
const Y &
b)
const
55#ifndef _RWSTD_NO_EXPLICIT_CTOR_INSTANTIATION
66#ifndef _RWSTD_NO_EMPTY_MEM_INITIALIZER
68template pair<DefaultConstructible, DefaultConstructible>::pair ();
72template pair<CopyConstructible, CopyConstructible>::
81template <
class T,
class U>
84 typedef std::pair<T, U>
Pair;
86 T *pt = (
typename Pair::first_type*)0;
87 U *pu = (
typename Pair::second_type*)0;
89 rw_info (0, 0, __LINE__,
"std::pair<%s, %s> data members", tname, uname);
104 std::pair<long, double>
p1 (*p0);
110 rw_info (0, 0, __LINE__,
"std::pair<%s, %s>::pair()", tname, uname);
117 "pair<Y, Y>::pair() called %d default ctors, "
120#ifndef _RWSTD_NO_EMPTY_MEM_INITIALIZER
124 "pair<Y, Y>::pair() called %d copy ctors, "
137 "std::pair<%s, %s>::pair(const %s&, const %s&)",
138 tname, uname, tname, uname);
146 std::pair<UserClass, UserClass> px0 (x0,
x1);
149 "pair<T, U>::pair (const T&, const U&) called %d cpy "
154 "template <class T, class U> "
155 "std::pair<%s, %s>::pair(const pair<T, U>&)",
161 std::pair<UserClass, UserClass> px (py);
164 "template <class T, class U> pair<UserClass, "
165 "UserClass>::pair(const std::pair<T, U>&) called "
166 "%d cpy ctors, expected 2",
171 "template <class T, class U> "
172 "std::pair<%s, %s>::operator= (const pair<T, U>&)",
182 "template <class T, class U> pair<UserClass, "
183 "UserClass>::operator=(const pair<T, U>&) "
184 "called %d cpy ctors, expected 0",
188 "template <class T, class U> pair<UserClass, "
189 "UserClass>::operator=(const pair<T, U>&) "
190 "called %d assignment operators, "
197#define FUN(result, name, arg_list) do { \
198 rw_info (0, 0, __LINE__, "%s(const pair<%s, %s>&, " \
199 "const pair<%s, %s>&)", #name, \
200 tname, uname, tname, uname); \
202 result (*_RWSTD_PASTE (pf, __LINE__)) arg_list = &name; \
203 _RWSTD_UNUSED (_RWSTD_PASTE (pf, __LINE__)); \
206 FUN (
bool, std::operator==, (
const Pair&,
const Pair&));
207 FUN (
bool, std::operator!=, (
const Pair&,
const Pair&));
208 FUN (
bool, std::operator<, (
const Pair&,
const Pair&));
209 FUN (
bool, std::operator<=, (
const Pair&,
const Pair&));
210 FUN (
bool, std::operator>, (
const Pair&,
const Pair&));
211 FUN (
bool, std::operator>=, (
const Pair&,
const Pair&));
216 Y::n_total_op_lt_ = 0;
220 "operator== (const pair<UserClass, UserClass>&, "
221 "const pair<UserClass, UserClass>&)");
222 rw_assert (2 == Y::n_total_op_eq_, 0, __LINE__,
223 "operator== (const pair<UserClass, UserClass>&, "
224 "const pair<UserClass, UserClass>&)");
231 p0.first.data_.val_ = 1;
232 p0.second.data_.val_ = 2;
234 p1.first.data_.val_ = 3;
235 p1.second.data_.val_ = 4;
242 "operator< (const pair<Y, Y>&, const pair<Y, Y>&)");
245 "less<Y>::operator() called %d time(s), expected 1",
248 p1.first.data_.val_ = 1;
255 "operator< (const pair<Y, Y>&, const pair<Y, Y>&)");
258 "less<Y>::operator() called %d time(s), expected 3",
261 p1.first.data_.val_ = 0;
268 "operator< (const pair<Y, Y>&, const pair<Y, Y>&)");
271 "less<Y>::operator() called %d time(s), expected 2",
281 test_pair (
char (),
"char",
long (),
"long");
282 test_pair (
int (),
"int",
float (),
"float");
289int main (
int argc,
char *argv[])
291 return rw_test (argc, argv, __FILE__,
base< def_ctor > DefaultConstructible
void test_pair(T, const char *tname, U, const char *uname)
#define FUN(result, name, arg_list)
base< cpy_ctor > CopyConstructible
void run_test(const ForwardIterator &dummy, T *, Predicate *pred)
#define _RWSTD_SPECIALIZED_CLASS
#define _RWSTD_UNUSED(arg)
#define _RWSTD_NAMESPACE(name)
_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 *,...)
static _RWSTD_SIZE_T n_total_op_assign_
static void reset_totals()
static _RWSTD_SIZE_T n_total_def_ctor_
static _RWSTD_SIZE_T n_total_copy_ctor_