1 /* -*- mode: C++; indent-tabs-mode: nil; -*-
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 concept checking
20 // utility from BOOST.
21 // See the appropriate copyright notice below.
23 // (C) Copyright Jeremy Siek 2000.
24 // Distributed under the Boost Software License, Version 1.0. (See
25 // accompanying file LICENSE_1_0.txt or copy at
26 // http://www.boost.org/LICENSE_1_0.txt)
29 // 05 May 2001: Workarounds for HP aCC from Thomas Matelich. (Jeremy Siek)
30 // 02 April 2001: Removed limits header altogether. (Jeremy Siek)
31 // 01 April 2001: Modified to use new <boost/limits.hpp> header. (JMaddock)
34 // See http://www.boost.org/libs/concept_check for documentation.
37 ///\brief Basic utilities for concept checking.
40 #ifndef LEMON_CONCEPT_CHECK_H
41 #define LEMON_CONCEPT_CHECK_H
46 "inline" is used for ignore_unused_variable_warning()
47 and function_requires() to make sure there is no
51 template <class T> inline void ignore_unused_variable_warning(const T&) { }
54 template <class Concept>
55 inline void function_requires()
58 void (Concept::*x)() = & Concept::constraints;
59 ignore_unused_variable_warning(x);
64 template <typename Concept, typename Type>
65 inline void checkConcept() {
67 typedef typename Concept::template Constraints<Type> ConceptCheck;
68 void (ConceptCheck::*x)() = & ConceptCheck::constraints;
69 ignore_unused_variable_warning(x);
75 #endif // LEMON_CONCEPT_CHECK_H