tools/llvm: Do not build with symbols
[minix3.git] / external / bsd / libc++ / dist / libcxx / test / containers / Emplaceable.h
blobaab290a3160ad4d93e184e5d8835f6b457052ecb
1 #ifndef EMPLACEABLE_H
2 #define EMPLACEABLE_H
4 #ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
6 class Emplaceable
8 Emplaceable(const Emplaceable&);
9 Emplaceable& operator=(const Emplaceable&);
11 int int_;
12 double double_;
13 public:
14 Emplaceable() : int_(0), double_(0) {}
15 Emplaceable(int i, double d) : int_(i), double_(d) {}
16 Emplaceable(Emplaceable&& x)
17 : int_(x.int_), double_(x.double_)
18 {x.int_ = 0; x.double_ = 0;}
19 Emplaceable& operator=(Emplaceable&& x)
20 {int_ = x.int_; x.int_ = 0;
21 double_ = x.double_; x.double_ = 0;
22 return *this;}
24 bool operator==(const Emplaceable& x) const
25 {return int_ == x.int_ && double_ == x.double_;}
26 bool operator<(const Emplaceable& x) const
27 {return int_ < x.int_ || (int_ == x.int_ && double_ < x.double_);}
29 int get() const {return int_;}
32 namespace std {
34 template <>
35 struct hash<Emplaceable>
36 : public std::unary_function<Emplaceable, std::size_t>
38 std::size_t operator()(const Emplaceable& x) const {return x.get();}
43 #endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
45 #endif // EMPLACEABLE_H