释放使用 get_temporary_buffer 模板函数,分配的临时内存。复制 template<class Type> void return_temporary_buffer( Type* _Pbuf ); 参数_Pbuf 要释放的内存的指针。备注应是瞬态的内存才使用此功能。示例复制 // memory_ret_temp_buf.cpp // compile with: /EHsc #include <memory> #include <iostream>...
释放使用 get_temporary_buffer 模板函数,分配的临时内存。 复制 template<class Type> void return_temporary_buffer( Type* _Pbuf ); 参数 _Pbuf 要释放的内存的指针。 备注 应是瞬态的内存才使用此功能。 示例 复制 // memory_ret_temp_buf.cpp // compile with: /EHsc #include <memory> #include ...
Deallocates the temporary memory that was allocated using the get_temporary_buffer template function.Copy template<class Type> void return_temporary_buffer( Type* _Pbuf ); Parameters_Pbuf A pointer to the memory to be deallocated.Remarks
template<class Type> void return_temporary_buffer( Type* _Pbuf ); Parameters _Pbuf A pointer to the memory to be deallocated. Remarks This function should only be used for memory that is temporary. Example // memory_ret_temp_buf.cpp // compile with: /EHsc #include <memory> #include <io...
解分配先前以 std::get_temporary_buffer 分配的存储。 参数p - 指向先前由 std::get_temporary_buffer 分配的存储,且未被之前到 return_temporary_buffer 的调用非法化的指针 返回值(无) 异常 (无) (C++17 起)示例运行此代码 #include <algorithm> #include <iostream> #include <memory> #include <string...
return_temporary_buffer Artigo 24/02/2013 Neste artigo Parâmetros Comentários Exemplo Requisitos Desaloca a memória temporária que foi atribuída usando a função do modelo de get_temporary_buffer .Copiar template<class Type> void return_temporary_buffer( Type* _Pbuf ); ...
return_temporary_buffer Artikel 26.02.2013 In diesem Artikel Parameter Hinweise Beispiel Anforderungen Gibt den temporären Speicher frei, der mithilfe der get_temporary_buffer Vorlagenfunktion zugeordnet wurde.Kopieren template<class Type> void return_temporary_buffer( Type* _Pbuf ); ...
second, [](std::string& e) { e.~basic_string<char>(); }); // 等同于:std::destroy(p.first, p.first + p.second); // 不使用 unique_ptr 这类技巧时要手动回收内存: // std::return_temporary_buffer(p.first); } 输出: string 1 test ... 返还临时缓冲区......
std::get_temporary_buffer std::return_temporary_buffer std::uninitialized_copy std::uninitialized_fill std::uninitialized_default_construct std::uninitialized_copy_n std::uninitialized_fill_n std::uninitialized_move_n std::uninitialized_default_construct_n std::uninitialized_value_construct_n std::con...
std::get_temporary_buffer std::return_temporary_buffer std::uninitialized_copy std::uninitialized_fill std::uninitialized_default_construct std::uninitialized_copy_n std::uninitialized_fill_n std::uninitialized_move_n std::uninitialized_default_construct_n std::uninitialized_value_construct_n std::con...