tag::doc_quick_look_7[]
| 107 | |
| 108 | // tag::doc_quick_look_7[] |
| 109 | value f() |
| 110 | { |
| 111 | // create a reference-counted memory resource |
| 112 | storage_ptr sp = make_shared_resource< monotonic_resource >(); |
| 113 | |
| 114 | // construct with shared ownership of the resource |
| 115 | value jv( sp ); |
| 116 | |
| 117 | // assign an array with 3 elements, the monotonic resource will be used |
| 118 | jv = { 1, 2, 3 }; |
| 119 | |
| 120 | // The caller receives the value, which still owns the resource |
| 121 | return jv; |
| 122 | } |
| 123 | // end::doc_quick_look_7[] |
| 124 | //---------------------------------------------------------- |
| 125 |