From 094da4b2f668565cedc301766e164f5c72c299fc Mon Sep 17 00:00:00 2001 From: Jeremy Siek Date: Tue, 21 Nov 2000 20:16:55 +0000 Subject: [PATCH] changed to new non-macro style, so don't need different 1..4 arguments versions [SVN r8277] --- ... => class_concept_checks_fail_expected.cpp | 4 ++- class_concept_checks_fail_expected2.cpp | 29 ---------------- class_concept_checks_fail_expected3.cpp | 29 ---------------- class_concept_checks_fail_expected4.cpp | 27 --------------- class_concept_checks_test.cpp | 20 ++++++----- ...d1.cpp => concept_checks_fail_expected.cpp | 2 +- concept_checks_fail_expected2.cpp | 24 ------------- concept_checks_fail_expected3.cpp | 24 ------------- concept_checks_fail_expected4.cpp | 24 ------------- concept_checks_test.cpp | 34 +++++++++---------- 10 files changed, 32 insertions(+), 185 deletions(-) rename class_concept_checks_fail_expected1.cpp => class_concept_checks_fail_expected.cpp (86%) delete mode 100644 class_concept_checks_fail_expected2.cpp delete mode 100644 class_concept_checks_fail_expected3.cpp delete mode 100644 class_concept_checks_fail_expected4.cpp rename concept_checks_fail_expected1.cpp => concept_checks_fail_expected.cpp (88%) delete mode 100644 concept_checks_fail_expected2.cpp delete mode 100644 concept_checks_fail_expected3.cpp delete mode 100644 concept_checks_fail_expected4.cpp diff --git a/class_concept_checks_fail_expected1.cpp b/class_concept_checks_fail_expected.cpp similarity index 86% rename from class_concept_checks_fail_expected1.cpp rename to class_concept_checks_fail_expected.cpp index f3bf60a..f266cf9 100644 --- a/class_concept_checks_fail_expected1.cpp +++ b/class_concept_checks_fail_expected.cpp @@ -16,9 +16,11 @@ struct foo { }; +using namespace boost; + class class_requires_test { - BOOST_CLASS_REQUIRES(foo, EqualityComparableConcept); + typedef class_requires< EqualityComparableConcept >::check req; }; int diff --git a/class_concept_checks_fail_expected2.cpp b/class_concept_checks_fail_expected2.cpp deleted file mode 100644 index e63127e..0000000 --- a/class_concept_checks_fail_expected2.cpp +++ /dev/null @@ -1,29 +0,0 @@ -// (C) Copyright Jeremy Siek 2000. Permission to copy, use, modify, -// sell and distribute this software is granted provided this -// copyright notice appears in all copies. This software is provided -// "as is" without express or implied warranty, and with no claim as -// to its suitability for any purpose. - -#include - -/* - - This file verifies that the BOOST_CLASS_REQUIRES2 macro - of the Boost Concept Checking Library catches errors - when it is suppose to. - -*/ - -struct foo { }; - -class class_requires_test -{ - BOOST_CLASS_REQUIRES2(foo, foo, Comparable2Concept); -}; - -int -main() -{ - class_requires_test x; - return 0; -} diff --git a/class_concept_checks_fail_expected3.cpp b/class_concept_checks_fail_expected3.cpp deleted file mode 100644 index 6c17f31..0000000 --- a/class_concept_checks_fail_expected3.cpp +++ /dev/null @@ -1,29 +0,0 @@ -// (C) Copyright Jeremy Siek 2000. Permission to copy, use, modify, -// sell and distribute this software is granted provided this -// copyright notice appears in all copies. This software is provided -// "as is" without express or implied warranty, and with no claim as -// to its suitability for any purpose. - -#include - -/* - - This file verifies that the BOOST_CLASS_REQUIRES3 macro - of the Boost Concept Checking Library catches errors - when it is suppose to. - -*/ - -struct foo { }; - -class class_requires_test -{ - BOOST_CLASS_REQUIRES3(foo, foo, foo, UnaryFunctionConcept); -}; - -int -main() -{ - class_requires_test x; - return 0; -} diff --git a/class_concept_checks_fail_expected4.cpp b/class_concept_checks_fail_expected4.cpp deleted file mode 100644 index bbbf468..0000000 --- a/class_concept_checks_fail_expected4.cpp +++ /dev/null @@ -1,27 +0,0 @@ -// (C) Copyright Jeremy Siek 2000. Permission to copy, use, modify, -// sell and distribute this software is granted provided this -// copyright notice appears in all copies. This software is provided -// "as is" without express or implied warranty, and with no claim as -// to its suitability for any purpose. - -#include - -/* - This file verifies that the BOOST_CLASS_REQUIRES4 macro - of the Boost Concept Checking Library catches errors - when it is suppose to. -*/ - -struct foo { }; - -class class_requires_test -{ - BOOST_CLASS_REQUIRES4(foo, foo, foo, foo, BinaryFunctionConcept); -}; - -int -main() -{ - class_requires_test x; - return 0; -} diff --git a/class_concept_checks_test.cpp b/class_concept_checks_test.cpp index d9667c0..3319560 100644 --- a/class_concept_checks_test.cpp +++ b/class_concept_checks_test.cpp @@ -8,23 +8,25 @@ /* - This file verifies that the BOOST_CLASS_REQUIRES macros of the - Boost Concept Checking Library do not cause errors when - they are not suppose to. + This file verifies that the boost::class_requires class of the Boost + Concept Checking Library do not cause errors when it is not suppose + to. */ struct foo { bool operator()(int) { return true; } }; struct bar { bool operator()(int, char) { return true; } }; +using namespace boost; + class class_requires_test { - BOOST_CLASS_REQUIRES(int, EqualityComparableConcept); - typedef int* int_ptr; - typedef const int* const_int_ptr; - BOOST_CLASS_REQUIRES2(int_ptr, const_int_ptr, Comparable2Concept); - BOOST_CLASS_REQUIRES3(foo, bool, int, UnaryFunctionConcept); - BOOST_CLASS_REQUIRES4(bar, bool, int, char, BinaryFunctionConcept); + typedef class_requires< EqualityComparableConcept >::check req1; + typedef class_requires >::check req2; + typedef class_requires >::check req3; + typedef class_requires >::check req4; + typedef class_requires >::check + req5; }; int diff --git a/concept_checks_fail_expected1.cpp b/concept_checks_fail_expected.cpp similarity index 88% rename from concept_checks_fail_expected1.cpp rename to concept_checks_fail_expected.cpp index 1618639..988029d 100644 --- a/concept_checks_fail_expected1.cpp +++ b/concept_checks_fail_expected.cpp @@ -19,6 +19,6 @@ struct foo { }; int main() { - BOOST_FUNCTION_REQUIRES(foo, EqualityComparableConcept); + boost::function_requires< boost::EqualityComparableConcept >(); return 0; } diff --git a/concept_checks_fail_expected2.cpp b/concept_checks_fail_expected2.cpp deleted file mode 100644 index c951aa3..0000000 --- a/concept_checks_fail_expected2.cpp +++ /dev/null @@ -1,24 +0,0 @@ -// (C) Copyright Jeremy Siek 2000. Permission to copy, use, modify, -// sell and distribute this software is granted provided this -// copyright notice appears in all copies. This software is provided -// "as is" without express or implied warranty, and with no claim as -// to its suitability for any purpose. - -#include - -/* - - This file verifies that the BOOST_FUNCTION_REQUIRES2 macro - of the Boost Concept Checking Library catches errors - when it is suppose to. - -*/ - -struct foo { }; - -int -main() -{ - BOOST_FUNCTION_REQUIRES2(foo, foo, Comparable2Concept); - return 0; -} diff --git a/concept_checks_fail_expected3.cpp b/concept_checks_fail_expected3.cpp deleted file mode 100644 index 42db55a..0000000 --- a/concept_checks_fail_expected3.cpp +++ /dev/null @@ -1,24 +0,0 @@ -// (C) Copyright Jeremy Siek 2000. Permission to copy, use, modify, -// sell and distribute this software is granted provided this -// copyright notice appears in all copies. This software is provided -// "as is" without express or implied warranty, and with no claim as -// to its suitability for any purpose. - -#include - -/* - - This file verifies that the BOOST_FUNCTION_REQUIRES3 macro - of the Boost Concept Checking Library catches errors - when it is suppose to. - -*/ - -struct foo { }; - -int -main() -{ - BOOST_FUNCTION_REQUIRES3(foo, foo, foo, UnaryFunctionConcept); - return 0; -} diff --git a/concept_checks_fail_expected4.cpp b/concept_checks_fail_expected4.cpp deleted file mode 100644 index 314cdd5..0000000 --- a/concept_checks_fail_expected4.cpp +++ /dev/null @@ -1,24 +0,0 @@ -// (C) Copyright Jeremy Siek 2000. Permission to copy, use, modify, -// sell and distribute this software is granted provided this -// copyright notice appears in all copies. This software is provided -// "as is" without express or implied warranty, and with no claim as -// to its suitability for any purpose. - -#include - -/* - - This file verifies that the BOOST_FUNCTION_REQUIRES4 macro - of the Boost Concept Checking Library catches errors - when it is suppose to. - -*/ - -struct foo { }; - -int -main() -{ - BOOST_FUNCTION_REQUIRES4(foo, foo, foo, foo, BinaryFunctionConcept); - return 0; -} diff --git a/concept_checks_test.cpp b/concept_checks_test.cpp index c79b571..1123f00 100644 --- a/concept_checks_test.cpp +++ b/concept_checks_test.cpp @@ -23,69 +23,69 @@ main() using namespace boost; { typedef default_constructible_archetype<> foo; - BOOST_FUNCTION_REQUIRES(foo, DefaultConstructibleConcept); + function_requires< DefaultConstructibleConcept >(); } { typedef copy_constructible_archetype<> foo; - BOOST_FUNCTION_REQUIRES(foo, CopyConstructibleConcept); + function_requires< CopyConstructibleConcept >(); } { typedef assignable_archetype<> foo; - BOOST_FUNCTION_REQUIRES(foo, AssignableConcept); + function_requires< AssignableConcept >(); } { typedef copy_constructible_archetype<> foo; typedef convertible_to_archetype convertible_to_foo; - BOOST_FUNCTION_REQUIRES2(convertible_to_foo, foo, ConvertibleConcept); + function_requires< ConvertibleConcept >(); } { - BOOST_FUNCTION_REQUIRES2(boolean_archetype, bool, ConvertibleConcept); + function_requires< ConvertibleConcept >(); } { typedef unary_function_archetype F; - BOOST_FUNCTION_REQUIRES3(F, int, int, UnaryFunctionConcept); + function_requires< UnaryFunctionConcept >(); } { typedef binary_function_archetype F; - BOOST_FUNCTION_REQUIRES4(F, int, int, int, BinaryFunctionConcept); + function_requires< BinaryFunctionConcept >(); } { typedef unary_predicate_archetype F; - BOOST_FUNCTION_REQUIRES2(F, int, UnaryPredicateConcept); + function_requires< UnaryPredicateConcept >(); } { typedef binary_predicate_archetype F; - BOOST_FUNCTION_REQUIRES3(F, int, int, BinaryPredicateConcept); + function_requires< BinaryPredicateConcept >(); typedef const_binary_predicate_archetype const_F; - BOOST_FUNCTION_REQUIRES3(const_F, int, int, Const_BinaryPredicateConcept); + function_requires< Const_BinaryPredicateConcept >(); } { typedef trivial_iterator_archetype Iter; - BOOST_FUNCTION_REQUIRES(Iter, TrivialIteratorConcept); + function_requires< TrivialIteratorConcept >(); } { typedef mutable_trivial_iterator_archetype Iter; - BOOST_FUNCTION_REQUIRES(Iter, Mutable_TrivialIteratorConcept); + function_requires< Mutable_TrivialIteratorConcept >(); } { typedef input_iterator_archetype Iter; - BOOST_FUNCTION_REQUIRES(Iter, InputIteratorConcept); + function_requires< InputIteratorConcept >(); } { typedef output_iterator_archetype Iter; - BOOST_FUNCTION_REQUIRES2(Iter, int, OutputIteratorConcept); + function_requires< OutputIteratorConcept >(); } { typedef forward_iterator_archetype Iter; - BOOST_FUNCTION_REQUIRES(Iter, ForwardIteratorConcept); + function_requires< ForwardIteratorConcept >(); } { typedef bidirectional_iterator_archetype Iter; - BOOST_FUNCTION_REQUIRES(Iter, BidirectionalIteratorConcept); + function_requires< BidirectionalIteratorConcept >(); } { typedef random_access_iterator_archetype Iter; - BOOST_FUNCTION_REQUIRES(Iter, RandomAccessIteratorConcept); + function_requires< RandomAccessIteratorConcept >(); } return 0;