insert_fn_imps.hpp revision 169691
1285242Sachim// -*- C++ -*- 2285242Sachim 3285242Sachim// Copyright (C) 2005, 2006 Free Software Foundation, Inc. 4285242Sachim// 5285242Sachim// This file is part of the GNU ISO C++ Library. This library is free 6285242Sachim// software; you can redistribute it and/or modify it under the terms 7285242Sachim// of the GNU General Public License as published by the Free Software 8285242Sachim// Foundation; either version 2, or (at your option) any later 9285242Sachim// version. 10285242Sachim 11285242Sachim// This library is distributed in the hope that it will be useful, but 12285242Sachim// WITHOUT ANY WARRANTY; without even the implied warranty of 13285242Sachim// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14285242Sachim// General Public License for more details. 15285242Sachim 16285242Sachim// You should have received a copy of the GNU General Public License 17285242Sachim// along with this library; see the file COPYING. If not, write to 18285242Sachim// the Free Software Foundation, 59 Temple Place - Suite 330, Boston, 19285242Sachim// MA 02111-1307, USA. 20285242Sachim 21285242Sachim// As a special exception, you may use this file as part of a free 22285242Sachim// software library without restriction. Specifically, if other files 23285242Sachim// instantiate templates or use macros or inline functions from this 24285242Sachim// file, or you compile this file and link it with other files to 25285242Sachim// produce an executable, this file does not by itself cause the 26285242Sachim// resulting executable to be covered by the GNU General Public 27285242Sachim// License. This exception does not however invalidate any other 28285242Sachim// reasons why the executable file might be covered by the GNU General 29285242Sachim// Public License. 30285242Sachim 31285242Sachim// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL. 32285242Sachim 33285242Sachim// Permission to use, copy, modify, sell, and distribute this software 34285242Sachim// is hereby granted without fee, provided that the above copyright 35285242Sachim// notice appears in all copies, and that both that copyright notice 36285242Sachim// and this permission notice appear in supporting documentation. None 37285242Sachim// of the above authors, nor IBM Haifa Research Laboratories, make any 38285242Sachim// representation about the suitability of this software for any 39285242Sachim// purpose. It is provided "as is" without express or implied 40285242Sachim// warranty. 41285242Sachim 42285242Sachim/** 43285242Sachim * @file insert_fn_imps.hpp 44285242Sachim * Contains an implementation class for ov_tree_. 45285242Sachim */ 46285242Sachim 47285242SachimPB_DS_CLASS_T_DEC 48285242Sachimvoid 49285242SachimPB_DS_CLASS_C_DEC:: 50285242Sachimreallocate_metadata(null_node_update_pointer, size_type) 51285242Sachim{ } 52285242Sachim 53285242SachimPB_DS_CLASS_T_DEC 54285242Sachimtemplate<typename Node_Update_> 55285242Sachimvoid 56285242SachimPB_DS_CLASS_C_DEC:: 57285242Sachimreallocate_metadata(Node_Update_* , size_type new_size) 58285242Sachim{ 59285242Sachim metadata_pointer a_new_metadata_vec =(new_size == 0) ? NULL : s_metadata_alloc.allocate(new_size); 60285242Sachim 61285242Sachim if (m_a_metadata != NULL) 62285242Sachim { 63285242Sachim for (size_type i = 0; i < m_size; ++i) 64285242Sachim m_a_metadata[i].~metadata_type(); 65285242Sachim s_metadata_alloc.deallocate(m_a_metadata, m_size); 66285242Sachim } 67285242Sachim std::swap(m_a_metadata, a_new_metadata_vec); 68285242Sachim} 69285242Sachim 70285242Sachim