Fix static member initializations (ticket #30).
3 * This file is a part of LEMON, a generic C++ optimization library
5 * Copyright (C) 2003-2008
6 * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
7 * (Egervary Research Group on Combinatorial Optimization, EGRES).
9 * Permission to use, modify and distribute this software is granted
10 * provided that this copyright notice appears in all copies. For
11 * precise terms see the accompanying LICENSE file.
13 * This software is provided "AS IS" with no warranty of any kind,
14 * express or implied, and with no claim as to its suitability for any
19 // This file contains a modified version of the enable_if library from BOOST.
20 // See the appropriate copyright notice below.
22 // Boost enable_if library
24 // Copyright 2003 © The Trustees of Indiana University.
26 // Use, modification, and distribution is subject to the Boost Software
27 // License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
28 // http://www.boost.org/LICENSE_1_0.txt)
30 // Authors: Jaakko Järvi (jajarvi at osl.iu.edu)
31 // Jeremiah Willcock (jewillco at osl.iu.edu)
32 // Andrew Lumsdaine (lums at osl.iu.edu)
35 #ifndef LEMON_BITS_UTILITY_H
36 #define LEMON_BITS_UTILITY_H
39 ///\brief Miscellaneous basic utilities
41 ///\todo Please rethink the organisation of the basic files like this.
42 ///E.g. this file might be merged with invalid.h.
48 /// Basic type for defining "tags". A "YES" condition for \c enable_if.
50 /// Basic type for defining "tags". A "YES" condition for \c enable_if.
54 /// \todo This should go to a separate "basic_types.h" (or something)
58 static const bool value = true;
61 /// Basic type for defining "tags". A "NO" condition for \c enable_if.
63 /// Basic type for defining "tags". A "NO" condition for \c enable_if.
68 static const bool value = false;
78 Wrap(const T &t) : value(t) {}
81 /**************** dummy class to avoid ambiguity ****************/
83 template<int T> struct dummy { dummy(int) {} };
85 /**************** enable_if from BOOST ****************/
87 template <typename Type, typename T = void>
93 template <bool B, class T = void>
99 struct enable_if_c<false, T> {};
101 template <class Cond, class T = void>
102 struct enable_if : public enable_if_c<Cond::value, T> {};
104 template <bool B, class T>
105 struct lazy_enable_if_c {
106 typedef typename T::type type;
110 struct lazy_enable_if_c<false, T> {};
112 template <class Cond, class T>
113 struct lazy_enable_if : public lazy_enable_if_c<Cond::value, T> {};
116 template <bool B, class T = void>
117 struct disable_if_c {
122 struct disable_if_c<true, T> {};
124 template <class Cond, class T = void>
125 struct disable_if : public disable_if_c<Cond::value, T> {};
127 template <bool B, class T>
128 struct lazy_disable_if_c {
129 typedef typename T::type type;
133 struct lazy_disable_if_c<true, T> {};
135 template <class Cond, class T>
136 struct lazy_disable_if : public lazy_disable_if_c<Cond::value, T> {};