| 191 | }; |
| 192 | |
| 193 | struct Moveable { |
| 194 | Moveable(int id) : moved(false), copied(false), id(id) { } |
| 195 | Moveable(Moveable&& o) MOODYCAMEL_NOEXCEPT : moved(true), copied(o.copied), id(o.id) { } |
| 196 | void operator=(Moveable&& o) MOODYCAMEL_NOEXCEPT { moved = true; copied = o.copied; id = o.id; } |
| 197 | bool moved; |
| 198 | bool copied; |
| 199 | int id; |
| 200 | |
| 201 | #if defined(_MSC_VER) && _MSC_VER < 1800 |
| 202 | // VS2012's std::is_nothrow_[move_]constructible is broken, so the queue never attempts to |
| 203 | // move objects with that compiler. In this case, we don't know whether it's really a copy |
| 204 | // or not being done, so give the benefit of the doubt (given the tests pass on other platforms) |
| 205 | // and assume it would have done a move if it could have (don't set copied to true). |
| 206 | Moveable(Moveable const& o) MOODYCAMEL_NOEXCEPT : moved(o.moved), copied(o.copied), id(o.id) { } |
| 207 | void operator=(Moveable const& o) MOODYCAMEL_NOEXCEPT { moved = o.moved; copied = o.copied; id = o.id; } |
| 208 | #else |
| 209 | Moveable(Moveable const& o) MOODYCAMEL_NOEXCEPT : moved(o.moved), copied(true), id(o.id) { } |
| 210 | void operator=(Moveable const& o) MOODYCAMEL_NOEXCEPT { moved = o.moved; copied = true; id = o.id; } |
| 211 | #endif |
| 212 | }; |
| 213 | |
| 214 | struct ThrowingMovable { |
| 215 | static std::atomic<int>& ctorCount() { static std::atomic<int> c; return c; } |