src/lemon/concept_check.h
changeset 1435 8e85e6bbefdf
parent 1434 d8475431bbbb
child 1436 e0beb94d08bf
     1.1 --- a/src/lemon/concept_check.h	Sat May 21 21:04:57 2005 +0000
     1.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.3 @@ -1,89 +0,0 @@
     1.4 -// -*- C++ -*-
     1.5 -// Modified for use in LEMON.
     1.6 -// We should really consider using Boost...
     1.7 -
     1.8 -
     1.9 -//
    1.10 -// (C) Copyright Jeremy Siek 2000.
    1.11 -// Distributed under the Boost Software License, Version 1.0. (See
    1.12 -// accompanying file LICENSE_1_0.txt or copy at
    1.13 -// http://www.boost.org/LICENSE_1_0.txt)
    1.14 -//
    1.15 -// Revision History:
    1.16 -//   05 May   2001: Workarounds for HP aCC from Thomas Matelich. (Jeremy Siek)
    1.17 -//   02 April 2001: Removed limits header altogether. (Jeremy Siek)
    1.18 -//   01 April 2001: Modified to use new <boost/limits.hpp> header. (JMaddock)
    1.19 -//
    1.20 -
    1.21 -// See http://www.boost.org/libs/concept_check for documentation.
    1.22 -
    1.23 -#ifndef LEMON_BOOST_CONCEPT_CHECKS_HPP
    1.24 -#define LEMON_BOOST_CONCEPT_CHECKS_HPP
    1.25 -
    1.26 -namespace lemon {
    1.27 -
    1.28 -  /*
    1.29 -    "inline" is used for ignore_unused_variable_warning()
    1.30 -    and function_requires() to make sure there is no
    1.31 -    overtarget with g++.
    1.32 -  */
    1.33 -
    1.34 -  template <class T> inline void ignore_unused_variable_warning(const T&) { }
    1.35 -
    1.36 -  template <class Concept>
    1.37 -  inline void function_requires()
    1.38 -  {
    1.39 -#if !defined(NDEBUG)
    1.40 -    void (Concept::*x)() = & Concept::constraints;
    1.41 -    ignore_unused_variable_warning(x);
    1.42 -#endif
    1.43 -  }
    1.44 -
    1.45 -  template <typename Concept, typename Type>
    1.46 -  inline void checkConcept() {
    1.47 -#if !defined(NDEBUG)
    1.48 -    typedef typename Concept::template Constraints<Type> ConceptCheck;
    1.49 -    void (ConceptCheck::*x)() = & ConceptCheck::constraints;
    1.50 -    ignore_unused_variable_warning(x);
    1.51 -#endif
    1.52 -  }
    1.53 -
    1.54 -#define BOOST_CLASS_REQUIRE(type_var, ns, concept) \
    1.55 -  typedef void (ns::concept <type_var>::* func##type_var##concept)(); \
    1.56 -  template <func##type_var##concept Tp1_> \
    1.57 -  struct concept_checking_##type_var##concept { }; \
    1.58 -  typedef concept_checking_##type_var##concept< \
    1.59 -    BOOST_FPTR ns::concept<type_var>::constraints> \
    1.60 -    concept_checking_typedef_##type_var##concept
    1.61 -
    1.62 -#define BOOST_CLASS_REQUIRE2(type_var1, type_var2, ns, concept) \
    1.63 -  typedef void (ns::concept <type_var1,type_var2>::* \
    1.64 -     func##type_var1##type_var2##concept)(); \
    1.65 -  template <func##type_var1##type_var2##concept Tp1_> \
    1.66 -  struct concept_checking_##type_var1##type_var2##concept { }; \
    1.67 -  typedef concept_checking_##type_var1##type_var2##concept< \
    1.68 -    BOOST_FPTR ns::concept<type_var1,type_var2>::constraints> \
    1.69 -    concept_checking_typedef_##type_var1##type_var2##concept
    1.70 -
    1.71 -#define BOOST_CLASS_REQUIRE3(tv1, tv2, tv3, ns, concept) \
    1.72 -  typedef void (ns::concept <tv1,tv2,tv3>::* \
    1.73 -     func##tv1##tv2##tv3##concept)(); \
    1.74 -  template <func##tv1##tv2##tv3##concept Tp1_> \
    1.75 -  struct concept_checking_##tv1##tv2##tv3##concept { }; \
    1.76 -  typedef concept_checking_##tv1##tv2##tv3##concept< \
    1.77 -    BOOST_FPTR ns::concept<tv1,tv2,tv3>::constraints> \
    1.78 -    concept_checking_typedef_##tv1##tv2##tv3##concept
    1.79 -
    1.80 -#define BOOST_CLASS_REQUIRE4(tv1, tv2, tv3, tv4, ns, concept) \
    1.81 -  typedef void (ns::concept <tv1,tv2,tv3,tv4>::* \
    1.82 -     func##tv1##tv2##tv3##tv4##concept)(); \
    1.83 -  template <func##tv1##tv2##tv3##tv4##concept Tp1_> \
    1.84 -  struct concept_checking_##tv1##tv2##tv3##tv4##concept { }; \
    1.85 -  typedef concept_checking_##tv1##tv2##tv3##tv4##concept< \
    1.86 -    BOOST_FPTR ns::concept<tv1,tv2,tv3,tv4>::constraints> \
    1.87 -    concept_checking_typedef_##tv1##tv2##tv3##tv4##concept
    1.88 -
    1.89 -
    1.90 -} // namespace lemon
    1.91 -
    1.92 -#endif // LEMON_BOOST_CONCEPT_CHECKS_HPP