TPIE

2362a60
unused.h
Go to the documentation of this file.
1 // -*- mode: c++; tab-width: 4; indent-tabs-mode: t; eval: (progn (c-set-style "stroustrup") (c-set-offset 'innamespace 0)); -*-
2 // vi:set ts=4 sts=4 sw=4 noet :
3 // Copyright 2008, The TPIE development team
4 //
5 // This file is part of TPIE.
6 //
7 // TPIE is free software: you can redistribute it and/or modify it under
8 // the terms of the GNU Lesser General Public License as published by the
9 // Free Software Foundation, either version 3 of the License, or (at your
10 // option) any later version.
11 //
12 // TPIE is distributed in the hope that it will be useful, but WITHOUT ANY
13 // WARRANTY; without even the implied warranty of MERCHANTABILITY or
14 // FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
15 // License for more details.
16 //
17 // You should have received a copy of the GNU Lesser General Public License
18 // along with TPIE. If not, see <http://www.gnu.org/licenses/>
19 
23 
24 #ifndef __TPIE_UNUSED_H__
25 #define __TPIE_UNUSED_H__
26 
27 #include <limits>
28 #include <utility>
29 
30 namespace tpie {
31 
32 template <typename T>
34  inline static T v() {return std::numeric_limits<T>::has_infinity ? std::numeric_limits<T>::infinity(): std::numeric_limits<T>::max();}
35 };
36 
37 template <typename T1, typename T2>
38 struct default_unused<std::pair<T1, T2> > {
39  inline static std::pair<T1,T2> v() {
40  return std::pair<T1, T2>(default_unused<T1>::v(), default_unused<T2>::v());
41  }
42 };
43 
44 } // namespace tpie
45 
46 #endif //__TPIE_UNUSED_H__