various changes, almost forgot to check in

[SVN r8379]
This commit is contained in:
Jeremy Siek 2000-12-03 06:20:23 +00:00
parent c8fbca2d44
commit 7c3a25a377
2 changed files with 25 additions and 1 deletions

View File

@ -170,6 +170,28 @@ denotes the address of <tt>u</tt>
<LI><tt>std::pair</tt>
</UL>
<h3>Concept Checking Class</h3>
<pre>
template &lt;class T&gt;
struct CopyConstructibleConcept
{
void constraints() {
T a(b); // require copy constructor
T* ptr = &amp;a; // require address of operator
const_constraints(a);
ignore_unused_variable_warning(ptr);
}
void const_constraints(const T&amp; a) {
T c(a); // require const copy constructor
const T* ptr = &amp;a; // require const address of operator
ignore_unused_variable_warning(c);
ignore_unused_variable_warning(ptr);
}
T b;
};
</pre>
<h3>See also</h3>
<A
href="http://www.sgi.com/Technology/STL/DefaultConstructible.html">DefaultConstructible</A>

View File

@ -7,7 +7,8 @@
#include <functional>
#include <algorithm>
#include <iostream>
#include <boost/iterator_adaptors.hpp>
#include <boost/pending/iterator_adaptors.hpp>
#include <boost/pending/integer_range.hpp>
int
main(int, char*[])
@ -15,6 +16,7 @@ main(int, char*[])
// This is a simple example of using the transform_iterators class to
// generate iterators that multiply the value returned by dereferencing
// the iterator. In this case we are multiplying by 2.
// Would be cooler to use lambda library in this example.
int x[] = { 1, 2, 3, 4, 5, 6, 7, 8 };