Back to index

texmacs  1.0.7.15
hashfunc.cpp
Go to the documentation of this file.
00001 
00002 /******************************************************************************
00003 * MODULE     : hashfunc.cpp
00004 * DESCRIPTION: fixed size hashfuncs with reference counting
00005 * COPYRIGHT  : (C) 1999  Joris van der Hoeven
00006 *******************************************************************************
00007 * This software falls under the GNU general public license version 3 or later.
00008 * It comes WITHOUT ANY WARRANTY WHATSOEVER. For details, see the file LICENSE
00009 * in the root directory or <http://www.gnu.org/licenses/gpl-3.0.html>.
00010 ******************************************************************************/
00011 
00012 #ifndef HASHFUNC_CC
00013 #define HASHFUNC_CC
00014 #include "hashfunc.hpp"
00015 
00016 template<class T, class U> U
00017 hashfunc_rep<T,U>::apply (T x) {
00018   if (remember->contains (x)) return remember[x];
00019   U y= func (x);
00020   remember(x)= y;
00021   return y;
00022 }
00023 
00024 #endif // defined HASHFUNC_CC