From 2b4788e18361897a14cddd5ceca9a314152cc0b7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ion=20Gazta=C3=B1aga?= Date: Mon, 16 Jun 2014 00:38:28 +0200 Subject: [PATCH] Fixed mimatched new[]/delete when using auto_ptr. --- test/file_mapping_test.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/test/file_mapping_test.cpp b/test/file_mapping_test.cpp index c9dcf07..c3ce161 100644 --- a/test/file_mapping_test.cpp +++ b/test/file_mapping_test.cpp @@ -14,7 +14,7 @@ #include #include #include -#include //std::auto_ptr +#include #include //std::exception #include //std::size_t #include "get_process_id_name.hpp" @@ -91,13 +91,13 @@ int main () std::ifstream file(get_filename().c_str(), std::ios::binary); //Create a memory buffer - std::auto_ptr memory (new unsigned char [FileSize/2 +1]); + boost::container::vector memory(FileSize/2 +1); //Fill buffer - file.read(static_cast(static_cast(memory.get())) + file.read(static_cast(static_cast(memory.data())) , FileSize/2); - unsigned char *checker = memory.get(); + unsigned char *checker = memory.data(); //Check pattern for(std::size_t i = 0 ;i < FileSize/2 @@ -108,10 +108,10 @@ int main () } //Fill buffer - file.read(static_cast(static_cast(memory.get())) + file.read(static_cast(static_cast(memory.data())) , FileSize - FileSize/2); - checker = memory.get(); + checker = memory.data(); //Check pattern for(std::size_t i = FileSize/2 ;i < FileSize