From 7e6db8d801973bfc62b80f411f14d1d332a1f7aa Mon Sep 17 00:00:00 2001 From: Tatsuhiro Tsujikawa Date: Wed, 3 Jul 2013 23:23:22 +0900 Subject: Use std::unique_ptr instead of array_ptr --- src/array_fun.h | 39 --------------------------------------- 1 file changed, 39 deletions(-) (limited to 'src/array_fun.h') diff --git a/src/array_fun.h b/src/array_fun.h index ed562ed8..b8054c36 100644 --- a/src/array_fun.h +++ b/src/array_fun.h @@ -53,45 +53,6 @@ char (&char_array_ref_fun(T (&)[0u]))[0u]; // To calculate size of array at compile time, we use macro here. #define A2_ARRAY_LEN(X) sizeof(char_array_ref_fun(X)) -template -class array_ptr { -private: - T* array_; - - // Copies are not allowed. Let's make them private. - array_ptr(const array_ptr& s); - - array_ptr& operator=(const array_ptr& s); - - template - array_ptr& operator=(const array_ptr& s); - -public: - array_ptr():array_(0) {} - - explicit array_ptr(T* array):array_(array) {} - - ~array_ptr() - { - delete [] array_; - } - - operator T*() - { - return array_; - } - - operator const T*() const - { - return array_; - } - - void reset(T* array) - { - array_ = array; - } -}; - template class array_wrapper { private: -- cgit