| 127 | } |
| 128 | |
| 129 | void move_assignment() // assignment |
| 130 | { |
| 131 | char buffer[1024]; |
| 132 | std::pmr::monotonic_buffer_resource pool{ std::data(buffer), std::size(buffer) }; |
| 133 | std::pmr::polymorphic_allocator<char> alloc(&pool); |
| 134 | |
| 135 | jsoncons::pmr::json j{ "String too long for short string", alloc }; |
| 136 | assert(j.is_string()); |
| 137 | assert(j.get_allocator().resource() == &pool); |
| 138 | |
| 139 | jsoncons::pmr::json j1{ 10 }; |
| 140 | assert(j1.is_number()); |
| 141 | |
| 142 | j1 = std::move(j); |
| 143 | assert(j1.is_string()); |
| 144 | assert(j1.get_allocator().resource() == &pool); |
| 145 | assert(j.is_number()); |
| 146 | } |
| 147 | |
| 148 | int main() |
| 149 | { |
no test coverage detected