forked from boostorg/concept_check
fixed obsolete use of class_requires
[SVN r8477]
This commit is contained in:
@@ -1,11 +1,8 @@
|
|||||||
#include <list>
|
#include <list>
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
|
|
||||||
struct foo {
|
int main() {
|
||||||
bool operator<(const foo&) const { return false; }
|
std::list<int> v;
|
||||||
};
|
|
||||||
int main(int, char*[]) {
|
|
||||||
std::list<foo> v;
|
|
||||||
std::stable_sort(v.begin(), v.end());
|
std::stable_sort(v.begin(), v.end());
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@@ -179,7 +179,7 @@ type for the map.
|
|||||||
</pre>
|
</pre>
|
||||||
|
|
||||||
|
|
||||||
As an example of using <tt>class_requires</tt> we look at a concept
|
As an example of using <tt>BOOST_CLASS_REQUIRES</tt> we look at a concept
|
||||||
check that could be added to <tt>std::vector</tt>. One requirement
|
check that could be added to <tt>std::vector</tt>. One requirement
|
||||||
that is placed on the element type is that it must be <a
|
that is placed on the element type is that it must be <a
|
||||||
href="http://www.sgi.com/Technology/STL/Assignable.html">Assignable</a>.
|
href="http://www.sgi.com/Technology/STL/Assignable.html">Assignable</a>.
|
||||||
@@ -191,7 +191,7 @@ of the definition for <tt>std::vector</tt>.
|
|||||||
namespace std {
|
namespace std {
|
||||||
template <class T>
|
template <class T>
|
||||||
struct vector {
|
struct vector {
|
||||||
typedef typename class_requires< AssignableConcept<T> >::check req;
|
BOOST_CLASS_REQUIRES(T, AssignableConcept);
|
||||||
...
|
...
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user