Ne.app NeANT
The Ne.app NeANT User module of the NeANT distribution.
23.vector.modifiers.stdcxx-495.cpp
Go to the documentation of this file.
1
29#include <cassert>
30#include <vector>
31
32struct X
33{
34 int __val;
35
36 X () : __val (0) { }
37 X (int val) : __val (val) { }
38 X (const X& x) : __val (x.__val) { }
39 X& operator= (const X& x) { __val = x.__val; return *this; }
40};
41
42bool operator== (const X& left, const X& right)
43{
44 return left.__val == right.__val;
45}
46
47template <class T>
48void test ()
49{
50 std::vector<T> vec;
51 vec.push_back (T (1));
52 vec.push_back (T (2));
53 vec.insert (vec.begin (), vec.back ());
54 assert (vec.front () == vec.back ());
55}
56
57int main ()
58{
59 test<int> ();
60 test<X> ();
61
62 return 0;
63}
#define T
Definition 17.names.cpp:163
#define x
Definition 17.names.cpp:140
#define val
Definition 17.names.cpp:570
#define left
#define right
bool operator==(const X &left, const X &right)
#define assert(expr)
Definition _cassert.h:40