1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/src/test/new_graph_test.cc Wed Oct 27 22:38:50 2004 +0000
1.3 @@ -0,0 +1,39 @@
1.4 +/* -*- C++ -*-
1.5 + * src/test/new_graph_test.cc - Part of LEMON, a generic C++ optimization library
1.6 + *
1.7 + * Copyright (C) 2004 Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
1.8 + * (Egervary Combinatorial Optimization Research Group, EGRES).
1.9 + *
1.10 + * Permission to use, modify and distribute this software is granted
1.11 + * provided that this copyright notice appears in all copies. For
1.12 + * precise terms see the accompanying LICENSE file.
1.13 + *
1.14 + * This software is provided "AS IS" with no warranty of any kind,
1.15 + * express or implied, and with no claim as to its suitability for any
1.16 + * purpose.
1.17 + *
1.18 + */
1.19 +
1.20 +#include <lemon/skeletons/graph.h>
1.21 +// #include <boost/concept_check.hpp>
1.22 +
1.23 +using namespace lemon::skeleton;
1.24 +
1.25 +// Borrowed from boost:
1.26 +template <class T> inline void ignore_unused_variable_warning(const T&) { }
1.27 +
1.28 +int main()
1.29 +{
1.30 + // This is the "right" way to check a concept:
1.31 + // boost::function_requires< BaseGraphItemConcept<BaseGraphItem> >();
1.32 +
1.33 + // which is equivalent (considering compile-time checks) to
1.34 + // BaseGraphItemConcept<BaseGraphItem> bgic;
1.35 + // bgic.constraints();
1.36 + // but not actually call or intatiates anything...
1.37 + // It's doing aproximately this:
1.38 + typedef BaseGraphItemConcept<BaseGraphItem> CC;
1.39 + void (CC::*x)() = &CC::constraints;
1.40 + ignore_unused_variable_warning(x);
1.41 + // But even more hackish...
1.42 +}