diff -r d8475431bbbb -r 8e85e6bbefdf src/lemon/concept_check.h --- a/src/lemon/concept_check.h Sat May 21 21:04:57 2005 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,89 +0,0 @@ -// -*- C++ -*- -// Modified for use in LEMON. -// We should really consider using Boost... - - -// -// (C) Copyright Jeremy Siek 2000. -// Distributed under the Boost Software License, Version 1.0. (See -// accompanying file LICENSE_1_0.txt or copy at -// http://www.boost.org/LICENSE_1_0.txt) -// -// Revision History: -// 05 May 2001: Workarounds for HP aCC from Thomas Matelich. (Jeremy Siek) -// 02 April 2001: Removed limits header altogether. (Jeremy Siek) -// 01 April 2001: Modified to use new header. (JMaddock) -// - -// See http://www.boost.org/libs/concept_check for documentation. - -#ifndef LEMON_BOOST_CONCEPT_CHECKS_HPP -#define LEMON_BOOST_CONCEPT_CHECKS_HPP - -namespace lemon { - - /* - "inline" is used for ignore_unused_variable_warning() - and function_requires() to make sure there is no - overtarget with g++. - */ - - template inline void ignore_unused_variable_warning(const T&) { } - - template - inline void function_requires() - { -#if !defined(NDEBUG) - void (Concept::*x)() = & Concept::constraints; - ignore_unused_variable_warning(x); -#endif - } - - template - inline void checkConcept() { -#if !defined(NDEBUG) - typedef typename Concept::template Constraints ConceptCheck; - void (ConceptCheck::*x)() = & ConceptCheck::constraints; - ignore_unused_variable_warning(x); -#endif - } - -#define BOOST_CLASS_REQUIRE(type_var, ns, concept) \ - typedef void (ns::concept ::* func##type_var##concept)(); \ - template \ - struct concept_checking_##type_var##concept { }; \ - typedef concept_checking_##type_var##concept< \ - BOOST_FPTR ns::concept::constraints> \ - concept_checking_typedef_##type_var##concept - -#define BOOST_CLASS_REQUIRE2(type_var1, type_var2, ns, concept) \ - typedef void (ns::concept ::* \ - func##type_var1##type_var2##concept)(); \ - template \ - struct concept_checking_##type_var1##type_var2##concept { }; \ - typedef concept_checking_##type_var1##type_var2##concept< \ - BOOST_FPTR ns::concept::constraints> \ - concept_checking_typedef_##type_var1##type_var2##concept - -#define BOOST_CLASS_REQUIRE3(tv1, tv2, tv3, ns, concept) \ - typedef void (ns::concept ::* \ - func##tv1##tv2##tv3##concept)(); \ - template \ - struct concept_checking_##tv1##tv2##tv3##concept { }; \ - typedef concept_checking_##tv1##tv2##tv3##concept< \ - BOOST_FPTR ns::concept::constraints> \ - concept_checking_typedef_##tv1##tv2##tv3##concept - -#define BOOST_CLASS_REQUIRE4(tv1, tv2, tv3, tv4, ns, concept) \ - typedef void (ns::concept ::* \ - func##tv1##tv2##tv3##tv4##concept)(); \ - template \ - struct concept_checking_##tv1##tv2##tv3##tv4##concept { }; \ - typedef concept_checking_##tv1##tv2##tv3##tv4##concept< \ - BOOST_FPTR ns::concept::constraints> \ - concept_checking_typedef_##tv1##tv2##tv3##tv4##concept - - -} // namespace lemon - -#endif // LEMON_BOOST_CONCEPT_CHECKS_HPP