source: XMLIO_V2/external/include/blitz/meta/metaprog.h @ 80

Last change on this file since 80 was 80, checked in by ymipsl, 14 years ago

ajout lib externe

  • Property svn:eol-style set to native
File size: 1.7 KB
Line 
1// -*- C++ -*-
2/***************************************************************************
3 * blitz/meta/metaprog.h   Useful metaprogram declarations
4 *
5 * $Id: metaprog.h,v 1.6 2005/05/07 04:17:57 julianc Exp $
6 *
7 * Copyright (C) 1997-2001 Todd Veldhuizen <tveldhui@oonumerics.org>
8 *
9 * This program is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU General Public License
11 * as published by the Free Software Foundation; either version 2
12 * of the License, or (at your option) any later version.
13 *
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17 * GNU General Public License for more details.
18 *
19 * Suggestions:          blitz-dev@oonumerics.org
20 * Bugs:                 blitz-bugs@oonumerics.org
21 *
22 * For more information, please see the Blitz++ Home Page:
23 *    http://oonumerics.org/blitz/
24 *
25 ***************************************************************************/
26
27#ifndef BZ_META_METAPROG_H
28#define BZ_META_METAPROG_H
29
30BZ_NAMESPACE(blitz)
31
32// Null Operand
33
34class _bz_meta_nullOperand {
35public:
36    _bz_meta_nullOperand() { }
37};
38
39template<typename T> inline T operator+(const T& a, _bz_meta_nullOperand)
40{ return a; }
41template<typename T> inline T operator*(const T& a, _bz_meta_nullOperand)
42{ return a; }
43
44// MetaMax
45
46template<int N1, int N2>
47class _bz_meta_max {
48public:
49    static const int max = (N1 > N2) ? N1 : N2;
50};
51
52// MetaMin
53
54template<int N1, int N2>
55class _bz_meta_min {
56public:
57    static const int min = (N1 < N2) ? N1 : N2;
58};
59
60BZ_NAMESPACE_END
61
62#endif // BZ_META_METAPROG_H
Note: See TracBrowser for help on using the repository browser.