xref: /aosp_15_r20/external/libcxx/test/std/containers/NotConstructible.h (revision 58b9f456b02922dfdb1fad8a988d5fd8765ecb80)
1*58b9f456SAndroid Build Coastguard Worker //===----------------------------------------------------------------------===//
2*58b9f456SAndroid Build Coastguard Worker //
3*58b9f456SAndroid Build Coastguard Worker //                     The LLVM Compiler Infrastructure
4*58b9f456SAndroid Build Coastguard Worker //
5*58b9f456SAndroid Build Coastguard Worker // This file is dual licensed under the MIT and the University of Illinois Open
6*58b9f456SAndroid Build Coastguard Worker // Source Licenses. See LICENSE.TXT for details.
7*58b9f456SAndroid Build Coastguard Worker //
8*58b9f456SAndroid Build Coastguard Worker //===----------------------------------------------------------------------===//
9*58b9f456SAndroid Build Coastguard Worker 
10*58b9f456SAndroid Build Coastguard Worker #ifndef NOTCONSTRUCTIBLE_H
11*58b9f456SAndroid Build Coastguard Worker #define NOTCONSTRUCTIBLE_H
12*58b9f456SAndroid Build Coastguard Worker 
13*58b9f456SAndroid Build Coastguard Worker #include <functional>
14*58b9f456SAndroid Build Coastguard Worker 
15*58b9f456SAndroid Build Coastguard Worker class NotConstructible
16*58b9f456SAndroid Build Coastguard Worker {
17*58b9f456SAndroid Build Coastguard Worker     NotConstructible(const NotConstructible&);
18*58b9f456SAndroid Build Coastguard Worker     NotConstructible& operator=(const NotConstructible&);
19*58b9f456SAndroid Build Coastguard Worker public:
20*58b9f456SAndroid Build Coastguard Worker };
21*58b9f456SAndroid Build Coastguard Worker 
22*58b9f456SAndroid Build Coastguard Worker inline
23*58b9f456SAndroid Build Coastguard Worker bool
24*58b9f456SAndroid Build Coastguard Worker operator==(const NotConstructible&, const NotConstructible&)
25*58b9f456SAndroid Build Coastguard Worker {return true;}
26*58b9f456SAndroid Build Coastguard Worker 
27*58b9f456SAndroid Build Coastguard Worker namespace std
28*58b9f456SAndroid Build Coastguard Worker {
29*58b9f456SAndroid Build Coastguard Worker 
30*58b9f456SAndroid Build Coastguard Worker template <>
31*58b9f456SAndroid Build Coastguard Worker struct hash<NotConstructible>
32*58b9f456SAndroid Build Coastguard Worker {
33*58b9f456SAndroid Build Coastguard Worker     typedef NotConstructible argument_type;
34*58b9f456SAndroid Build Coastguard Worker     typedef std::size_t result_type;
35*58b9f456SAndroid Build Coastguard Worker 
36*58b9f456SAndroid Build Coastguard Worker     std::size_t operator()(const NotConstructible&) const {return 0;}
37*58b9f456SAndroid Build Coastguard Worker };
38*58b9f456SAndroid Build Coastguard Worker 
39*58b9f456SAndroid Build Coastguard Worker }
40*58b9f456SAndroid Build Coastguard Worker 
41*58b9f456SAndroid Build Coastguard Worker #endif  // NOTCONSTRUCTIBLE_H
42