| 171 | namespace my_library { |
| 172 | |
| 173 | std::pmr::vector<char> get_chars2() |
| 174 | { |
| 175 | // Declare a local memory resource |
| 176 | my_resource mr; |
| 177 | |
| 178 | // Construct a vector that uses our resource |
| 179 | std::pmr::vector<char> v( &mr ); |
| 180 | |
| 181 | // Undefined behavior, `mr` goes out of scope! |
| 182 | return v; |
| 183 | } |
| 184 | |
| 185 | } // my_library |
| 186 | // end::doc_background_8[] |
nothing calls this directly
no outgoing calls
no test coverage detected