resize_no_store_hash_fn_imps.hpp revision 256281
1234949Sbapt// -*- C++ -*-
2234949Sbapt
3297276Sjkim// Copyright (C) 2005, 2006 Free Software Foundation, Inc.
4234949Sbapt//
5297276Sjkim// This file is part of the GNU ISO C++ Library.  This library is free
6234949Sbapt// software; you can redistribute it and/or modify it under the terms
7251143Sbapt// of the GNU General Public License as published by the Free Software
8251143Sbapt// Foundation; either version 2, or (at your option) any later
9251143Sbapt// version.
10234949Sbapt
11234949Sbapt// This library is distributed in the hope that it will be useful, but
12251143Sbapt// WITHOUT ANY WARRANTY; without even the implied warranty of
13251143Sbapt// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14251143Sbapt// General Public License for more details.
15251143Sbapt
16234949Sbapt// You should have received a copy of the GNU General Public License
17234949Sbapt// along with this library; see the file COPYING.  If not, write to
18251143Sbapt// the Free Software Foundation, 59 Temple Place - Suite 330, Boston,
19234949Sbapt// MA 02111-1307, USA.
20234949Sbapt
21234949Sbapt// As a special exception, you may use this file as part of a free
22234949Sbapt// software library without restriction.  Specifically, if other files
23251143Sbapt// instantiate templates or use macros or inline functions from this
24251143Sbapt// file, or you compile this file and link it with other files to
25251143Sbapt// produce an executable, this file does not by itself cause the
26234949Sbapt// resulting executable to be covered by the GNU General Public
27234949Sbapt// License.  This exception does not however invalidate any other
28296240Sjkim// reasons why the executable file might be covered by the GNU General
29234949Sbapt// Public License.
30234949Sbapt
31234949Sbapt// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
32234949Sbapt
33234949Sbapt// Permission to use, copy, modify, sell, and distribute this software
34234949Sbapt// is hereby granted without fee, provided that the above copyright
35234949Sbapt// notice appears in all copies, and that both that copyright notice
36297276Sjkim// and this permission notice appear in supporting documentation. None
37234949Sbapt// of the above authors, nor IBM Haifa Research Laboratories, make any
38234949Sbapt// representation about the suitability of this software for any
39234949Sbapt// purpose. It is provided "as is" without express or implied
40234949Sbapt// warranty.
41234949Sbapt
42234949Sbapt/**
43234949Sbapt * @file resize_no_store_hash_fn_imps.hpp
44234949Sbapt * Contains implementations of cc_ht_map_'s resize related functions, when the
45234949Sbapt *    hash value is not stored.
46234949Sbapt */
47234949Sbapt
48234949SbaptPB_DS_CLASS_T_DEC
49234949Sbaptinline typename PB_DS_CLASS_C_DEC::entry_pointer
50234949SbaptPB_DS_CLASS_C_DEC::
51234949Sbaptresize_imp_no_exceptions_reassign_pointer(entry_pointer p_e, entry_pointer_array a_p_entries_resized, false_type)
52234949Sbapt{
53234949Sbapt  const size_type hash_pos =
54234949Sbapt    ranged_hash_fn_base::operator()(PB_DS_V2F(p_e->m_value));
55234949Sbapt
56297276Sjkim  entry_pointer const p_next_e = p_e->m_p_next;
57234949Sbapt  p_e->m_p_next = a_p_entries_resized[hash_pos];
58234949Sbapt  a_p_entries_resized[hash_pos] = p_e;
59234949Sbapt  return p_next_e;
60234949Sbapt}
61234949Sbapt