| 66 | } |
| 67 | |
| 68 | int |
| 69 | main(int, char**) |
| 70 | { |
| 71 | |
| 72 | value const jv = { 1, 2, 3, 4, 5, 6, 7, 8 }; |
| 73 | |
| 74 | unsigned char buf[1024]; |
| 75 | pmr::monotonic_buffer_resource mr( buf, sizeof(buf) ); |
| 76 | |
| 77 | auto v = value_to< pmr::vector<int> >( |
| 78 | jv, |
| 79 | use_allocator( pmr::polymorphic_allocator<int>(&mr) ) ); |
| 80 | |
| 81 | assert( v.size() == jv.as_array().size() ); |
| 82 | |
| 83 | for( auto i = 0u; i < v.size(); ++i ) |
| 84 | assert( v[i] == jv.at(i).to_number<int>() ); |
| 85 | |
| 86 | return EXIT_SUCCESS; |
| 87 | } |
| 88 | |
| 89 | // end::example_use_allocator[] |
nothing calls this directly
no test coverage detected