mirror of
https://github.com/boostorg/concept_check.git
synced 2025-08-02 14:04:35 +02:00
Moved Collection concept into Boost.ConceptCheck; moved other MultiArray concepts into boost::multi_array_concepts and documented them in reference.xml (do not know how to rebuild HTML from that); fixes #4032
[SVN r62611]
This commit is contained in:
@@ -1,5 +1,7 @@
|
|||||||
//
|
//
|
||||||
// (C) Copyright Jeremy Siek 2000.
|
// (C) Copyright Jeremy Siek 2000.
|
||||||
|
// Copyright 2002 The Trustees of Indiana University.
|
||||||
|
//
|
||||||
// Distributed under the Boost Software License, Version 1.0. (See
|
// Distributed under the Boost Software License, Version 1.0. (See
|
||||||
// accompanying file LICENSE_1_0.txt or copy at
|
// accompanying file LICENSE_1_0.txt or copy at
|
||||||
// http://www.boost.org/LICENSE_1_0.txt)
|
// http://www.boost.org/LICENSE_1_0.txt)
|
||||||
@@ -999,6 +1001,42 @@ namespace boost
|
|||||||
|
|
||||||
// HashedAssociativeContainer
|
// HashedAssociativeContainer
|
||||||
|
|
||||||
|
BOOST_concept(Collection,(C))
|
||||||
|
{
|
||||||
|
BOOST_CONCEPT_USAGE(Collection)
|
||||||
|
{
|
||||||
|
boost::function_requires<boost::InputIteratorConcept<iterator> >();
|
||||||
|
boost::function_requires<boost::InputIteratorConcept<const_iterator> >();
|
||||||
|
boost::function_requires<boost::CopyConstructibleConcept<value_type> >();
|
||||||
|
const_constraints(c);
|
||||||
|
i = c.begin();
|
||||||
|
i = c.end();
|
||||||
|
c.swap(c);
|
||||||
|
}
|
||||||
|
|
||||||
|
void const_constraints(const C& c) {
|
||||||
|
ci = c.begin();
|
||||||
|
ci = c.end();
|
||||||
|
n = c.size();
|
||||||
|
b = c.empty();
|
||||||
|
}
|
||||||
|
|
||||||
|
private:
|
||||||
|
typedef typename C::value_type value_type;
|
||||||
|
typedef typename C::iterator iterator;
|
||||||
|
typedef typename C::const_iterator const_iterator;
|
||||||
|
typedef typename C::reference reference;
|
||||||
|
typedef typename C::const_reference const_reference;
|
||||||
|
// typedef typename C::pointer pointer;
|
||||||
|
typedef typename C::difference_type difference_type;
|
||||||
|
typedef typename C::size_type size_type;
|
||||||
|
|
||||||
|
C c;
|
||||||
|
bool b;
|
||||||
|
iterator i;
|
||||||
|
const_iterator ci;
|
||||||
|
size_type n;
|
||||||
|
};
|
||||||
} // namespace boost
|
} // namespace boost
|
||||||
|
|
||||||
# include <boost/concept/detail/concept_undef.hpp>
|
# include <boost/concept/detail/concept_undef.hpp>
|
||||||
|
@@ -279,6 +279,10 @@ struct <a href=
|
|||||||
template <class C>
|
template <class C>
|
||||||
struct <a href=
|
struct <a href=
|
||||||
"http://www.sgi.com/tech/stl/SortedAssociativeContainer.html">SortedAssociativeContainer</a>;
|
"http://www.sgi.com/tech/stl/SortedAssociativeContainer.html">SortedAssociativeContainer</a>;
|
||||||
|
|
||||||
|
template <class C>
|
||||||
|
struct <a href=
|
||||||
|
"../utility/Collection.html">Collection</a>;
|
||||||
</pre>
|
</pre>
|
||||||
|
|
||||||
<h3><a name="basic-archetype" id="basic-archetype">Basic Archetype
|
<h3><a name="basic-archetype" id="basic-archetype">Basic Archetype
|
||||||
|
Reference in New Issue
Block a user