Ne.app NeANT
The Ne.app NeANT User module of the NeANT distribution.
23.vector.cons.cpp
Go to the documentation of this file.
1
29#include <memory> // for placement operator new()
30#include <vector> // for vector
31
32#include <cstddef> // for size_t
33
34#include <rw_alg_test.h>
35#include <rw_value.h> // for UserClass
36#include <rw_driver.h>
37#include <rw_new.h>
38
39
41static unsigned rw_opt_nloops;
42static int rw_opt_no_int_spec;
43static int rw_opt_no_short_spec;
44static int rw_opt_no_types;
45static int rw_opt_no_signatures;
46static int rw_opt_no_ctors;
47
48
50template <class RandomAccessIterator,
51 class T,
52 class Reference,
53 class Pointer,
54 class Difference>
56{
58};
59
60
62// outlined to prevent gcc -Winline warnings
63template <class RandomAccessIterator,
64 class T,
65 class Reference,
66 class Pointer,
67 class Difference>
70{
71 static int i; // zeroed out
72 if (++i) // prevent "unreachable code" warnings
73 return; // compile only
74
75 // exercise RandomAccessIterator requirements
76
78 RandomAccessIterator it_cpy (it);
79
80 Difference d (it - it);
81
82 RandomAccessIterator &it_ref1 = ++it;
83 const RandomAccessIterator &it_ref2 = it++;
84
85 RandomAccessIterator &it_ref3 = --it;
86 const RandomAccessIterator &it_ref4 = it--;
87
88 RandomAccessIterator &it_ref5 = it += 1;
89 it_cpy = it + d;
90 it_cpy = d + it;
91
92 RandomAccessIterator &it_ref6 = it -= 1;
93 it_cpy = it - d;
94
95 T t (it [d]);
96
97 Reference ref1 (*it);
98 Reference ref2 (*it++);
99
100 bool b (it == it);
101 b = it != it;
102 b = it > it;
103 b = it >= it;
104 b = it <= it;
105
106
107 _RWSTD_UNUSED (it);
108 _RWSTD_UNUSED (it_cpy);
109 _RWSTD_UNUSED (it_ref1);
110 _RWSTD_UNUSED (it_ref2);
111 _RWSTD_UNUSED (it_ref3);
112 _RWSTD_UNUSED (it_ref4);
113 _RWSTD_UNUSED (it_ref5);
114 _RWSTD_UNUSED (it_ref6);
117 _RWSTD_UNUSED (ref1);
118 _RWSTD_UNUSED (ref2);
120}
121
122
124// verify that nested types are properly defined
125template <class Vector, class T, class Allocator>
127{
128#define TEST_TYPE(T, vectorT) { \
129 T *t = (typename Vector::vectorT*)0; \
130 _RWSTD_UNUSED (t); \
131 }
132
133#define TEST_REFERENCE(T, vectorT) { \
134 typename Vector::value_type v; \
135 T t = v; \
136 _RWSTD_UNUSED (t); \
137 }
138
139 // verify nested types
140 TEST_TYPE (T, value_type);
141 TEST_TYPE (Allocator, allocator_type);
142 TEST_TYPE (typename Allocator::pointer, pointer);
143 TEST_TYPE (typename Allocator::const_pointer, const_pointer);
144
145#ifndef _RWSTD_NO_CLASS_PARTIAL_SPEC
146
147 typedef std::reverse_iterator<typename Vector::iterator>
148 ReverseIterator;
149 typedef std::reverse_iterator<typename Vector::const_iterator>
150 ConstReverseIterator;
151
152#else // if defined (_RWSTD_NO_CLASS_PARTIAL_SPEC)
153
154 typedef std::reverse_iterator<typename Vector::iterator,
155 std::random_access_iterator_tag, T /*non-const T&, non-const T* */>
156 ReverseIterator;
157
158 typedef std::reverse_iterator<typename Vector::const_iterator,
159 std::random_access_iterator_tag, T, const T&, const T*>
160 ConstReverseIterator;
161
162#endif // _RWSTD_NO_CLASS_PARTIAL_SPEC
163
164 TEST_TYPE (ReverseIterator, reverse_iterator);
165 TEST_TYPE (ConstReverseIterator, const_reverse_iterator);
166
168 ti; // exercise iterator requirements
169 test_iterator<typename Vector::const_iterator, T, const T&, const T*,
170 std::ptrdiff_t>
171 tci; // exercise iterator requirements
172
174 tri; // exercise iterator requirements
176 tcri; // exercise iterator requirements
177
178 _RWSTD_UNUSED (ti); _RWSTD_UNUSED (tci);
179 _RWSTD_UNUSED (tri); _RWSTD_UNUSED (tcri);
180
181 // special treatment
182 TEST_REFERENCE (typename Allocator::reference, reference);
183 TEST_REFERENCE (typename Allocator::const_reference, const_reference);
184}
185
186
188// verify that member functions are properly defined
189template <class Vector, class T, class Allocator>
191{
192// verify that a member function is accessible and has the appropriate
193// signature, including return type and exception specification
194#define MEMFUN(result, name, arg_list) do { \
195 result (Vector::*pf) arg_list = &Vector::name; \
196 _RWSTD_UNUSED (pf); \
197 } while (0)
198
199 MEMFUN (Vector&, operator=, (const Vector&));
200
201 // helpers to work around a SunPro 5.3 bug (see PR #25972)
202 typedef typename Vector::size_type SizeType;
203 typedef typename Vector::value_type ValueType;
204 typedef typename Vector::iterator Iterator;
205
206 // verify signatures of iterator accessors
207 MEMFUN (typename Vector::iterator, begin, ());
208 MEMFUN (typename Vector::const_iterator, begin, () const);
209 MEMFUN (typename Vector::iterator, end, ());
210 MEMFUN (typename Vector::const_iterator, end, () const);
211
212 // verify signatures of reverse iterator accessors
213 MEMFUN (typename Vector::reverse_iterator, rbegin, ());
214 MEMFUN (typename Vector::const_reverse_iterator, rbegin, () const);
215 MEMFUN (typename Vector::reverse_iterator, rend, ());
216 MEMFUN (typename Vector::const_reverse_iterator, rend, () const);
217
218 // verify signatures of capacity accessors
219 MEMFUN (SizeType, size, () const);
220 MEMFUN (SizeType, max_size, () const);
221 MEMFUN (void, resize, (SizeType, ValueType));
222 MEMFUN (SizeType, capacity, () const);
223 MEMFUN (bool, empty, () const);
224 MEMFUN (void, reserve, (SizeType));
225
226 // verify signature of the element access functions
227 MEMFUN (const T&, operator[], (SizeType) const);
228 MEMFUN (T&, operator[], (SizeType));
229 MEMFUN (const T&, at, (SizeType) const);
230 MEMFUN (T&, at, (SizeType));
231 MEMFUN (const T&, front, () const);
232 MEMFUN (T&, front, ());
233 MEMFUN (const T&, back, () const);
234 MEMFUN (T&, back, ());
235
236 // verify signatures of modifiers
237 MEMFUN (void, push_back, (const T&));
238 MEMFUN (void, pop_back, ());
239
240 MEMFUN (Iterator, insert, (Iterator, const T&));
241
242 MEMFUN (void, insert, (Iterator, SizeType, const T&));
243
244#if !defined (_MSC_VER) || _MSC_VER >= 1300
245 // member function template insert
246 MEMFUN (void, insert, (Iterator, InputIter<T>, InputIter<T>));
247#endif // !defined (_MSC_VER) || _MSC_VER >= 1300
248
249 MEMFUN (Iterator, erase, (Iterator));
250 MEMFUN (Iterator, erase, (Iterator, Iterator));
251
252 MEMFUN (void, swap, (Vector&));
253 MEMFUN (void, clear, ());
254
255#if !defined (_MSC_VER) || _MSC_VER > 1300
256
257#define FUN(result, name, arg_list) do { \
258 result (*pf) arg_list = &name; \
259 _RWSTD_UNUSED (pf); \
260 } while (0)
261
262 // verify signatures of non-member functions
263 FUN (bool, std::operator==, (const Vector&, const Vector&));
264 FUN (bool, std::operator<, (const Vector&, const Vector&));
265 FUN (bool, std::operator!=, (const Vector&, const Vector&));
266 FUN (bool, std::operator>, (const Vector&, const Vector&));
267 FUN (bool, std::operator>=, (const Vector&, const Vector&));
268 FUN (bool, std::operator<=, (const Vector&, const Vector&));
269 FUN (void, std::swap, (Vector&, Vector&));
270
271#else // MSVC <= 7.0
272
273 // working around a bug in MSVC 7 and prior (see PR #26625)
274
275 if (0 /* compile only */) {
276
277 Vector *pv = 0;
278 const Vector *pcv = 0;
279
280 bool b;
281 b = std::operator== (*pcv, *pcv);
282 b = std::operator< (*pcv, *pcv);
283 b = std::operator!= (*pcv, *pcv);
284 b = std::operator> (*pcv, *pcv);
285 b = std::operator>= (*pcv, *pcv);
286 b = std::operator<= (*pcv, *pcv);
287 std::swap (*pv, *pv);
288 }
289
290#endif // MSVC <= 7.0
291
292}
293
294
296// exercise [lib.vector.cons] and vector<>::operator=()
297// focus on the correct construction and destruction of values
299{
300 typedef std::vector<UserClass, std::allocator<UserClass> > Vector;
301
302 if (1) {
303
304 rw_info (0, 0, 0,
305 "std::vector<UserClass>::vector(size_type, "
306 "const_reference, const allocator_type&)");
307
308 rw_info (0, 0, 0, "std::vector<UserClass>::vector(const vector&)");
309
310 // reset function call counters
312
313 // total number of objects of type UserClass in existence
314 const std::size_t x_count = UserClass::count_;
315
316 for (Vector::size_type i = 0; i != rw_opt_nloops; ++i) {
317
318 rw_assert (UserClass::count_ == x_count, 0, __LINE__,
319 "vector<UserClass>::vector(size_type, const_reference); "
320 "leaked %zu objects of value_type",
321 UserClass::count_ - x_count);
322
323 // reset function call counters
325
326 const UserClass val;
327
328 // initialize a vector with `i' copies of `val'
329 const Vector v0 (i, val);
330 rw_assert ( i == v0.size ()
331 && v0.begin () + i == v0.end ()
332 && v0.rbegin () + i == v0.rend (),
333 0, __LINE__,
334 "vector<UserClass>::vector(size_type, const_reference)");
335
336 // verify that the vector ctor calls only copy ctor
337 // of UserClass and anly the given number of times each
338 rw_assert (UserClass::is_total (i + 1, 1, i, 0, 0, 0), 0, __LINE__,
339 "vector<UserClass>::vector(size_type, const_reference); "
340 "called default/copy ctor and operator=() %zu, %zu, "
341 "and %zu times, respectively, 0, %zu, 0 expected",
345
346 // create a copy
347 Vector v1 (v0);
348 rw_assert ( i == v1.size ()
349 && v1.begin () + i == v1.end ()
350 && v1.rbegin () + i == v1.rend (),
351 0, __LINE__,
352 "vector<UserClass>::vector(const vector&)");
353
354 // verify that the vector copy ctor calls only copy ctor
355 // of UserClass and anly the given number of times each
356 rw_assert (UserClass::is_total (2 * i + 1, 1, 2 * i, 0, 0, 0),
357 0, __LINE__,
358 "vector<UserClass>::vector(size_type, const_reference); "
359 "called default/copy ctor and operator=() %zu, %zu, "
360 "and %zu times, respectively, 0, %zu, 0 expected",
364
365 // exercise vector<>operator=(const vector&)
366 Vector v2 (i, val);
367
368 for (Vector::size_type j = 0; j != rw_opt_nloops; ++j) {
369
370 Vector v3 (j, val);
371
372 // assign a vector (of a possibly unequal size)
373 v3 = v2;
374 rw_assert (v3.size () == v2.size (), 0, __LINE__,
375 "%zu. vector<UserClass>::operator=(const vector&)",
376 j);
377
378 rw_assert (v3 == v2, 0, __LINE__,
379 "%zu. vector<UserClass>::operator=(const vector&)",
380 j);
381 }
382
383#ifndef _RWSTD_NO_EXCEPTIONS
384
385 // exercise vector exception safety
386
387 bool thrown = false;
388
389 // create a suitably aligned buffer in which to construct
390 // the vector object
391 union {
392 void *pad;
393 char buf [sizeof (Vector)];
394 } buf = { 0 };
395
396 std::size_t x_count_save = UserClass::count_;
397
398 try {
399 // have UserClass copy ctor throw an exception during
400 // the copying of the last value
403
404 // create a vector object, throw an exception
405 // expect vector ctor to destroy any values
406 // constructed prior to throwing the exception
407 // and to free all already allocated memory
408
409 // use placement new to prevent vector destruction
410 // at scope exit (the object should be destroyed
411 // during stack unwinding instead)
412 Vector *p = new (&buf.buf) Vector (i, val);
413
414 // destroy explicitly if ctor doesn't propagate exception
415
416#if !defined (__HP_aCC) || _RWSTD_HP_aCC_MINOR > 3800
417
418 p->~Vector ();
419#else
420 // work around aCC bug (see PR #25356)
421 p->~vector ();
422
423#endif // HP aCC
424
425 }
426 catch (...) {
427 thrown = true;
428 }
429
430 // no exception thrown if (i == 0), no elements constructed
431 rw_assert (i == 0 || thrown, 0, __LINE__,
432 "logic error: failed to throw");
433
434 rw_assert (x_count_save == UserClass::count_, 0, __LINE__,
435 "vector<UserClass>::vector(size_type, const_reference) "
436 "leaked %zu value(s) of %zu after an exception",
437 UserClass::count_ - x_count_save, i);
438
439 // exercise vector<>::vector(const vector&)
440 thrown = false;
441 x_count_save = UserClass::count_;
442
443 try {
444 // have UserClass copy ctor throw an exception during
445 // the copying of the last value
448
449 // use placement new to prevent vector destruction
450 // at scope exit (the object should be destroyed
451 // during stack unwinding instead)
452 Vector *p = new (&buf) Vector (v1);
453
454 // destroy explicitly if ctor doesn't propagate exception
455
456#if !defined (__HP_aCC) || _RWSTD_HP_aCC_MINOR > 3800
457
458 p->~Vector ();
459#else
460 // work around aCC bug (see PR #25356)
461 p->~vector ();
462
463#endif // HP aCC
464
465 }
466 catch (...) {
467 // vector should have been destroyed
468 thrown = true;
469 }
470
471 // no exception thrown if (i == 0), no elements constructed
472 rw_assert(i == 0 || thrown, 0, __LINE__,
473 "logic error: failed to throw");
474
475 rw_assert (x_count_save == UserClass::count_, 0, __LINE__,
476 "vector<UserClass>::vector(const vector&) leaked "
477 "%zu value(s) of %zu after an exception",
478 UserClass::count_ - x_count_save, i);
479
480
481 // disable exceptions
482 UserClass::copy_ctor_throw_count_ = std::size_t (-1);
483
484 // remember v1's size and capacity
485 const Vector::size_type v1_size = v1.size ();
486 const Vector::size_type v1_cap = v1.capacity ();
487
488 // create and initialize vector with some values
489 // make sure v3's capacity is greater than that of v1
490 // (otherwise the assignment isn't exception safe since
491 // it simply overwrites existing values for efficiency)
492 const Vector v3 (v1_cap * 2, val);
493
494 // exrecise vector<>::operator=(const vector&)
495 thrown = false;
496 x_count_save = UserClass::count_;
497
498 try {
499 // have UserClass copy ctor throw an exception during
500 // the copying of the last value
503
504 // assign over the existing elements, the last copy ctor or
505 // operator=() throws, destroying all values assigned so far
506 v1 = v3;
507 }
508 catch (...) {
509 // original vector must remain unchanged
510 thrown = true;
511 }
512
513 // disable exceptions
514 UserClass::copy_ctor_throw_count_ = std::size_t (-1);
515
516 rw_assert (i == 0 || thrown, 0, __LINE__,
517 "logic error: failed to throw");
518
519 // verify that no values leaked
520 rw_assert (x_count_save == UserClass::count_, 0, __LINE__,
521 "vector<UserClass>::vector(const vector&) leaked "
522 "%zu value(s) of %zu after an exception",
523 UserClass::count_ - x_count_save, i);
524
525 // verify that the size of the left hand size operand
526 // of the assignment hasn't changed
527 rw_assert (v1.size () == v1_size && v1.capacity () == v1_cap,
528 0, __LINE__, "vector<UserClass>::operator="
529 "(const vector&) changed size of *this from "
530 "%zu to %zu after exception",
531 i / 2, v3.size ());
532
533#endif // _RWSTD_NO_EXCEPTIONS
534
535 // vectors go out of scope, must destroy all elements
536 }
537 }
538}
539
540// exercise [lib.vector.cons]
541template <class Vector, class T, class Alloc>
543{
544 if (1) {
545
546 rw_info (0, 0, 0,
547 "std::vector<UserClass>::vector(const allocator_type&)");
548
549 // verify default ctor arguments
550 Vector v0;
551 Vector v1 (alloc);
552
553 rw_assert ( 0 == v0.size ()
554 && v0.empty () && v0.begin () == v0.end ()
555 && v0.rbegin () == v0.rend (), 0, __LINE__,
556 ("vector<UserClass>::vector()"));
557
558 rw_assert ( 0 == v1.size ()
559 && v1.empty () && v1.begin () == v1.end ()
560 && v1.rbegin () == v1.rend (), 0, __LINE__,
561 "vector<UserClass>::vector()");
562 }
563
564 if (1) {
565
566 rw_info (0, 0, 0,
567 "std::vector<UserClass>::vector(size_type, "
568 "const_reference, const allocator_type&)");
569
570 for (typename Vector::size_type i = 0; i != rw_opt_nloops; ++i) {
571
572 const T val = T (i);
573
574 Vector v0 (i, val);
575 Vector v1 (i, val, alloc);
576
577 rw_assert ( i == v0.size ()
578 && v0.begin () + i == v0.end ()
579 && v0.rbegin () + i == v0.rend (),
580 0, __LINE__,
581 "vector<UserClass>::vector"
582 "(size_type, const_reference)");
583
584 rw_assert ( i == v1.size ()
585 && v1.begin () + i == v1.end ()
586 && v1.rbegin () + i == v1.rend (),
587 0, __LINE__,
588 "vector<UserClass>::vector(size_type, "
589 "const_reference, const allocator_type&)");
590
591 bool success = true;
592 for (typename Vector::size_type j = 0; j != i; ++j) {
593 if (!(success = v0 [j] == val))
594 break;
595 if (!(success = v1 [j] == val))
596 break;
597 }
598
599 rw_assert (success, 0, __LINE__,
600 "vector<UserClass>::vector(size_type, const_reference); "
601 "all elements initialized");
602 }
603 }
604
605#if !defined (_MSC_VER) || _MSC_VER >= 1300
606
607 if (1) {
608
609 rw_info (0, 0, 0,
610 "template <class InputIterator> std::vector<UserClass>::vector"
611 "(InputIterator, InputIterator)");
612
613 bool success = true;
614
615 // allocate nloops elements, do not initialize
616 typename Vector::value_type *vals = alloc.allocate (rw_opt_nloops);
617
618 for (typename Vector::size_type i = 0; i != rw_opt_nloops; ++i) {
619
620 // construct an element at then end of array
621 alloc.construct (vals + i, typename Alloc::value_type (i));
622
623 // verify ctor with a strict InputIterator
624 InputIter<T> first (vals, vals, vals + i);
625 InputIter<T> last (vals + i, vals + i, vals + i);
626
627 const Vector v0 (first, last);
628
629 // reset iterators since they are single-pass and their
630 // copies have been passed through by the ctor above
631 first = InputIter<T>(vals, vals, vals + i);
632 last = InputIter<T>(vals + i, vals + i, vals + i);
633
634 const Vector v1 (first, last, alloc);
635
636 if ( i != v0.size ()
637 || (!((i && !v0.empty ()) || (!i && v0.empty ())))
638 || (i != v1.size ())
639 || (!((i && !v1.empty ()) || (!i && v1.empty ()))))
640 success = false;
641
642 // verify size() and empty()
643 rw_assert (i == v0.size (), 0, __LINE__,
644 "size () == %zu, got %zu", i, v0.size ());
645
646 rw_assert ((i && !v0.empty ()) || (!i && v0.empty ()),
647 0, __LINE__, "size () == %zu, empty () == %d",
648 v0.size (), v0.empty ());
649
650 rw_assert (i == v1.size (), 0, __LINE__,
651 "size () == %zu, got %zu", i, v1.size ());
652
653 rw_assert ((i && !v1.empty ()) || (!i && v1.empty ()),
654 0, __LINE__, "size () == %zu, empty () == %d",
655 v1.size (), v1.empty ());
656 }
657
658 rw_assert (success, 0, __LINE__,
659 "template <class InputIterator> "
660 "std::vector<UserClass>::vector"
661 "(InputIterator, InputIterator)");
662
663 // destroy and deallocate...
664 for (typename Vector::size_type j = 0; j != rw_opt_nloops; ++j)
665 alloc.destroy (vals + j);
666
667 alloc.deallocate (vals, rw_opt_nloops);
668 }
669
670#endif // !defined (_MSC_VER) || _MSC_VER >= 1300
671
672}
673
674
676static int
677run_test (int /* argc */, char** /* argv */)
678{
679 static int int_noted = 0;
680 static int short_noted = 0;
681 static int types_noted = 0;
682 static int sign_noted = 0;
683 static int ctors_noted = 0;
684
685#ifndef _RWSTD_NO_EXCEPTIONS
686
687 try {
688 // throw an exception to initialize the lib (allocates
689 // memory that's never deallocated; shows up as leaks)
690 _RW::__rw_throw (_RWSTD_ERROR_LOGIC_ERROR, "", "");
691 }
692 catch (...) {
693 }
694
695#endif // _RWSTD_NO_EXCEPTIONS
696
697// for convenience (in case default template arguments are disabled)
698#define VECTOR(T) std::vector<T, std::allocator<T> >
699
700#define TEST(what, T) \
701 do { \
702 /* establish a checkpoint for memory leaks */ \
703 rwt_check_leaks (0, 0); \
704 test_ ##what ((VECTOR (T)*)0, (T*)0, std::allocator<T>()); \
705 /* verify that no memory leaked */ \
706 std::size_t nbytes; \
707 const std::size_t nblocks = rwt_check_leaks (&nbytes, 0); \
708 rw_assert (!nblocks && !nbytes, 0, __LINE__, \
709 #what " test leaked %lu bytes in %lu blocks", \
710 nbytes, nblocks); \
711 } while (0)
712
713 if (rw_opt_no_int_spec) {
714 rw_note (int_noted++, 0, __LINE__,
715 "int specializations test disabled.");
716 }
717 else {
718 // exercise vector and its default template argument
719 if (rw_opt_no_types) {
720 rw_note (types_noted++, 0, __LINE__, "Types test disabled.");
721 }
722 else {
723 TEST (types, int);
724 }
725
726 if (rw_opt_no_signatures) {
727 rw_note (sign_noted++, 0, __LINE__, "Signatures test disabled.");
728 }
729 else {
730 TEST (signatures, int);
731 }
732
733 if (rw_opt_no_ctors) {
734 rw_note (ctors_noted++, 0, __LINE__, "Ctors test disabled.");
735 }
736 else {
737 TEST (ctors, int);
738 }
739 }
740
741 // exercise vector with a template argument other than the default
742#undef VECTOR
743#define VECTOR(T, A) std::vector<T, A<T> >
744
745#undef TEST
746#define TEST(what,T,A) test_ ##what ((VECTOR (T, A)*)0, (T*)0, A<T>())
747
748 if (rw_opt_no_short_spec) {
749 rw_note (short_noted++, 0, __LINE__,
750 "short specializations test disabled.");
751 }
752 else {
753 if (rw_opt_no_types) {
754 rw_note (types_noted++, 0, __LINE__, "Types test disabled.");
755 }
756 else {
757 TEST (types, short, std::allocator);
758 }
759
760 if (rw_opt_no_signatures) {
761 rw_note (sign_noted++, 0, __LINE__, "Signatures test disabled.");
762 }
763 else {
764 TEST (signatures, short, std::allocator);
765 }
766
767 if (rw_opt_no_ctors) {
768 rw_note (ctors_noted++, 0, __LINE__, "Ctors test disabled.");
769 }
770 else {
771 TEST (ctors, short, std::allocator);
772 }
773 }
774
775 if (rw_opt_no_ctors) {
776 rw_note (ctors_noted++, 0, __LINE__, "Ctors test disabled.");
777 }
778 else {
779 test_ctors ();
780 }
781
782 return 0;
783}
784
785
787int main (int argc, char** argv)
788{
789 return rw_test (argc, argv, __FILE__,
790 "lib.vector.cons",
791 0 /* no comment */,
792 run_test,
793 "|-nloops#1 "
794 "|-no-int_specializations# "
795 "|-no-short_specializations# "
796 "|-no-types# "
797 "|-no-signatures# "
798 "|-no-ctors#",
800 &rw_opt_no_int_spec,
801 &rw_opt_no_short_spec,
802 &rw_opt_no_types,
803 &rw_opt_no_signatures,
804 &rw_opt_no_ctors);
805}
InputIter< UserClass > Iterator
#define i
Definition 17.names.cpp:126
#define T
Definition 17.names.cpp:163
#define t
Definition 17.names.cpp:136
#define d
Definition 17.names.cpp:115
#define alloc
Definition 17.names.cpp:441
#define last
Definition 17.names.cpp:487
#define v2
Definition 17.names.cpp:271
#define RandomAccessIterator
Definition 17.names.cpp:528
#define buf
Definition 17.names.cpp:452
#define j
Definition 17.names.cpp:127
#define Reference
Definition 17.names.cpp:529
#define b
Definition 17.names.cpp:110
#define val
Definition 17.names.cpp:570
#define p
Definition 17.names.cpp:132
#define Pointer
Definition 17.names.cpp:517
#define v1
Definition 17.names.cpp:245
std::vector< UserClass, std::allocator< UserClass > > Vector
void test_signatures(Vector *, T *, Allocator)
void test_types(Vector *, T *, Allocator)
#define TEST_REFERENCE(T, vectorT)
#define TEST(what, T)
#define FUN(result, name, arg_list)
#define MEMFUN(result, name, arg_list)
#define TEST_TYPE(T, vectorT)
void test_ctors()
int rw_opt_nloops
Definition 25.copy.cpp:235
void run_test(const ForwardIterator &dummy, T *, Predicate *pred)
const int end
#define main
#define _RWSTD_UNUSED(arg)
Definition _defs.h:972
#define _RWSTD_ERROR_LOGIC_ERROR
Definition _error.h:89
_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 *,...)
Definition driver.cpp:1681
_TEST_EXPORT int rw_note(int, const char *, int, const char *,...)
Definition driver.cpp:1664
_TEST_EXPORT int rw_assert(int, const char *, int, const char *,...)
Definition driver.cpp:1630
static _RWSTD_SIZE_T n_total_op_assign_
Definition rw_value.h:127
static bool is_total(_RWSTD_SIZE_T count, _RWSTD_SIZE_T n_def_ctor, _RWSTD_SIZE_T n_copy_ctor, _RWSTD_SIZE_T n_op_assign, _RWSTD_SIZE_T n_op_eq, _RWSTD_SIZE_T n_op_lt)
Definition value.cpp:419
static _RWSTD_SIZE_T copy_ctor_throw_count_
Definition rw_value.h:164
static _RWSTD_SIZE_T count_
Definition rw_value.h:120
static void reset_totals()
Definition value.cpp:452
static _RWSTD_SIZE_T n_total_def_ctor_
Definition rw_value.h:124
static _RWSTD_SIZE_T n_total_copy_ctor_
Definition rw_value.h:125