BWAPI
SPAR/AIModule/BWTA/vendors/CGAL/CGAL/constant.h
Go to the documentation of this file.
00001 // Copyright (c) 2006  INRIA Sophia-Antipolis (France).
00002 // All rights reserved.
00003 //
00004 // This file is part of CGAL (www.cgal.org); you can redistribute it and/or
00005 // modify it under the terms of the GNU Lesser General Public License as
00006 // published by the Free Software Foundation; version 2.1 of the License.
00007 // See the file LICENSE.LGPL distributed with CGAL.
00008 //
00009 // Licensees holding a valid commercial license may use this file in
00010 // accordance with the commercial license agreement provided with the software.
00011 //
00012 // This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
00013 // WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
00014 //
00015 // $URL: svn+ssh://scm.gforge.inria.fr/svn/cgal/branches/CGAL-3.5-branch/Number_types/include/CGAL/constant.h $
00016 // $Id: constant.h 37955 2007-04-05 13:02:19Z spion $
00017 //
00018 //
00019 // Author(s)     : Sylvain Pion
00020 
00021 #ifndef CGAL_CONSTANT_H
00022 #define CGAL_CONSTANT_H
00023 
00024 #include <CGAL/config.h>
00025 
00026 CGAL_BEGIN_NAMESPACE
00027 
00028 // The function constant<T, int i>() returns a const reference to T(i).
00029 // TODO : is it worth documenting ?
00030 
00031 template < typename T, int i >
00032 inline
00033 const T&
00034 constant()
00035 {
00036   static const T t(i);
00037   return t;
00038 }
00039 
00040 CGAL_END_NAMESPACE
00041 
00042 #endif // CGAL_CONSTANT_H
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines