From 72e7f011b29998d8a3e15eb5b381ef962af5fe5b Mon Sep 17 00:00:00 2001 From: Karen Arutyunov Date: Fri, 5 Apr 2019 10:30:58 +0300 Subject: Upgrade to 8.0.15 --- mysql/extra/yassl/taocrypt/mySTL/memory_array.hpp | 135 ---------------------- 1 file changed, 135 deletions(-) delete mode 100644 mysql/extra/yassl/taocrypt/mySTL/memory_array.hpp (limited to 'mysql/extra/yassl/taocrypt/mySTL/memory_array.hpp') diff --git a/mysql/extra/yassl/taocrypt/mySTL/memory_array.hpp b/mysql/extra/yassl/taocrypt/mySTL/memory_array.hpp deleted file mode 100644 index 1c238d9..0000000 --- a/mysql/extra/yassl/taocrypt/mySTL/memory_array.hpp +++ /dev/null @@ -1,135 +0,0 @@ -/* - Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved. - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; version 2 of the License. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; see the file COPYING. If not, write to the - Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, - MA 02110-1301 USA. -*/ - - -/* mySTL memory_arry implements auto_array - * - */ - -#ifndef mySTL_MEMORY_ARRAY_HPP -#define mySTL_MEMORY_ARRAY_HPP - - -#ifdef _MSC_VER - // disable operator-> warning for builtins - #pragma warning(disable:4284) -#endif - - -namespace mySTL { - - -template -struct auto_array_ref { - T* ptr_; - explicit auto_array_ref(T* p) : ptr_(p) {} -}; - - -template -class auto_array { - T* ptr_; - - void Destroy() - { - #ifdef YASSL_LIB - yaSSL::ysArrayDelete(ptr_); - #else - TaoCrypt::tcArrayDelete(ptr_); - #endif - } -public: - explicit auto_array(T* p = 0) : ptr_(p) {} - - ~auto_array() - { - Destroy(); - } - - - auto_array(auto_array& other) : ptr_(other.release()) {} - - auto_array& operator=(auto_array& that) - { - if (this != &that) { - Destroy(); - ptr_ = that.release(); - } - return *this; - } - - - T* operator->() const - { - return ptr_; - } - - T& operator*() const - { - return *ptr_; - } - - T* get() const - { - return ptr_; - } - - T* release() - { - T* tmp = ptr_; - ptr_ = 0; - return tmp; - } - - void reset(T* p = 0) - { - if (ptr_ != p) { - Destroy(); - ptr_ = p; - } - } - - // auto_array_ref conversions - auto_array(auto_array_ref ref) : ptr_(ref.ptr_) {} - - auto_array& operator=(auto_array_ref ref) - { - if (this->ptr_ != ref.ptr_) { - Destroy(); - ptr_ = ref.ptr_; - } - return *this; - } - - template - operator auto_array() - { - return auto_array(this->release()); - } - - template - operator auto_array_ref() - { - return auto_array_ref(this->release()); - } -}; - - -} // namespace mySTL - -#endif // mySTL_MEMORY_ARRAY_HPP -- cgit v1.1