diff --git a/concept_check.htm b/concept_check.htm index 4a47fa8..fc385dc 100644 --- a/concept_check.htm +++ b/concept_check.htm @@ -220,7 +220,7 @@ bad_error_eg.cpp:8: instantiated from here
In this case, the fundamental error is that std:complex<float> does not model the LessThanComparable + "http://www.boost.org/sgi/stl/LessThanComparable.html">LessThanComparable concept. Unfortunately, there is nothing in the error message to indicate that to the user.
@@ -232,7 +232,7 @@ bad_error_eg.cpp:8: instantiated from here__insertion_sort
) that the user
@@ -268,7 +268,7 @@ boost/concept_check.hpp:236: error: no match for ‘operator<’ in ‘((boos
As an example of how to create a concept checking class template, we look at how to create the corresponding checks for the InputIterator concept. + "http://www.boost.org/sgi/stl/InputIterator.html">InputIterator concept. The complete definition is here:
template <class X> diff --git a/implementation.htm b/implementation.htm index 66af1fe..e9db3bf 100644 --- a/implementation.htm +++ b/implementation.htm @@ -104,7 +104,7 @@ checks, we wrap the member function pointer mechanism in a function named function_requires(). The following code snippet shows how to use function_requires() to make sure that the iterator is a RandomAccessIterator. + "http://www.boost.org/sgi/stl/RandomAccessIterator.html">RandomAccessIterator.template <class Iter> void stable_sort(Iter first, Iter last) diff --git a/prog_with_concepts.htm b/prog_with_concepts.htm index fb04aed..f78a40c 100644 --- a/prog_with_concepts.htm +++ b/prog_with_concepts.htm @@ -60,7 +60,7 @@ in the concept. For example, the std::stable_sort() function requires that the value type of the iterator be +href="http://www.boost.org/sgi/stl/LessThanComparable.html"> LessThanComparable, which not only includes operator<(), but also operator>(), operator<=(), and operator>=(). @@ -68,19 +68,19 @@ It turns out that std::stable_sort() only uses operator<(). The question then arises: should std::stable_sort() be specified in terms of the concept +href="http://www.boost.org/sgi/stl/LessThanComparable.html"> LessThanComparable or in terms of a concept that only requires operator<()?We remark first that the use of +href="http://www.boost.org/sgi/stl/LessThanComparable.html"> LessThanComparable does not really violate the requirement minimization principle because all of the other operators can be trivially implemented in terms of operator<(). By ``trivial'' we mean one line of code and a constant run-time cost. More fundamentally, however, the use of +href="http://www.boost.org/sgi/stl/LessThanComparable.html"> LessThanComparable does not violate the requirement minimization principle because all of the comparison operators (<, >, <=, >=) are conceptually equivalent (in @@ -98,7 +98,7 @@ implementation in places to use operator>() instead of requirements are part of the public interface, such a change could potentially break client code. If instead +href="http://www.boost.org/sgi/stl/LessThanComparable.html"> LessThanComparable is given as the requirement for std::stable_sort(), then the maintainer is given a reasonable amount of flexibility within which to work. @@ -110,9 +110,9 @@ amount of flexibility within which to work. basic containers, requiring traversal in a single direction is a smaller requirement than requiring traversal in both directions (hence the distinction between ForwardIterator and + "http://www.boost.org/sgi/stl/ForwardIterator.html">ForwardIterator and BidirectionalIterator). + "http://www.boost.org/sgi/stl/BidirectionalIterator.html">BidirectionalIterator). The semantic difference can be easily seen in the difference between the set of concrete data structures that have forward iterators versus the set that has bidirectional iterators. For example, singly-linked lists would diff --git a/reference.htm b/reference.htm index ae8d502..efb3f61 100644 --- a/reference.htm +++ b/reference.htm @@ -106,11 +106,11 @@ struct Assignable; +"http://www.boost.org/sgi/stl/Assignable.html">Assignable; template <class T> struct DefaultConstructible; +"http://www.boost.org/sgi/stl/DefaultConstructible.html">DefaultConstructible; template <class T> struct EqualityComparable; // Standard ref 20.1.1 +"http://www.boost.org/sgi/stl/EqualityComparable.html">EqualityComparable; // Standard ref 20.1.1 template <class T> struct LessThanComparable concept +"http://www.boost.org/sgi/stl/LessThanComparable.html">LessThanComparable concept
Iterator Concept @@ -134,29 +134,29 @@ struct Comparable; // The SGI STL template <class Iter> struct InputIterator; // Standard ref 24.1.1 Table 72 +"http://www.boost.org/sgi/stl/InputIterator.html">InputIterator; // Standard ref 24.1.1 Table 72 template <class Iter, class T> struct OutputIterator; // Standard ref 24.1.2 Table 73 +"http://www.boost.org/sgi/stl/OutputIterator.html">OutputIterator; // Standard ref 24.1.2 Table 73 template <class Iter> struct ForwardIterator; // Standard ref 24.1.3 Table 74 +"http://www.boost.org/sgi/stl/ForwardIterator.html">ForwardIterator; // Standard ref 24.1.3 Table 74 template <class Iter> struct Mutable_ForwardIterator; template <class Iter> struct BidirectionalIterator; // Standard ref 24.1.4 Table 75 +"http://www.boost.org/sgi/stl/BidirectionalIterator.html">BidirectionalIterator; // Standard ref 24.1.4 Table 75 template <class Iter> struct Mutable_BidirectionalIterator; template <class Iter> struct RandomAccessIterator; // Standard ref 24.1.5 Table 76 +"http://www.boost.org/sgi/stl/RandomAccessIterator.html">RandomAccessIterator; // Standard ref 24.1.5 Table 76 template <class Iter> struct Mutable_RandomAccessIterator; @@ -169,46 +169,46 @@ struct Mutable_RandomAccessIterator; #include "boost/concept_check.hpp" template <class Func, class Return> -struct Generator; +struct Generator; template <class Func, class Return, class Arg> struct UnaryFunction; +"http://www.boost.org/sgi/stl/UnaryFunction.html">UnaryFunction; template <class Func, class Return, class First, class Second> struct BinaryFunction; +"http://www.boost.org/sgi/stl/BinaryFunction.html">BinaryFunction; template <class Func, class Arg> struct UnaryPredicate; +"http://www.boost.org/sgi/stl/Predicate.html">Predicate; template <class Func, class First, class Second> struct BinaryPredicate; +"http://www.boost.org/sgi/stl/BinaryPredicate.html">BinaryPredicate; template <class Func, class First, class Second> struct Const_BinaryPredicate; template <class Func, class Return> struct AdaptableGenerator; +"http://www.boost.org/sgi/stl/AdaptableGenerator.html">AdaptableGenerator; template <class Func, class Return, class Arg> struct AdaptableUnaryFunction; +"http://www.boost.org/sgi/stl/AdaptableUnaryFunction.html">AdaptableUnaryFunction; template <class Func, class First, class Second> struct AdaptableBinaryFunction; +"http://www.boost.org/sgi/stl/AdaptableBinaryFunction.html">AdaptableBinaryFunction; template <class Func, class Arg> struct AdaptablePredicate; +"http://www.boost.org/sgi/stl/AdaptablePredicate.html">AdaptablePredicate; template <class Func, class First, class Second> struct AdaptableBinaryPredicate; +"http://www.boost.org/sgi/stl/AdaptableBinaryPredicate.html">AdaptableBinaryPredicate;
template <class T>