summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to '3rdParty/Boost/src/boost/concept_check.hpp')
-rw-r--r--3rdParty/Boost/src/boost/concept_check.hpp28
1 files changed, 15 insertions, 13 deletions
diff --git a/3rdParty/Boost/src/boost/concept_check.hpp b/3rdParty/Boost/src/boost/concept_check.hpp
index bf5a2af..292f37d 100644
--- a/3rdParty/Boost/src/boost/concept_check.hpp
+++ b/3rdParty/Boost/src/boost/concept_check.hpp
@@ -1,69 +1,75 @@
//
// (C) Copyright Jeremy Siek 2000.
// Copyright 2002 The Trustees of Indiana University.
//
// Distributed under the Boost Software License, Version 1.0. (See
// accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
//
// Revision History:
// 05 May 2001: Workarounds for HP aCC from Thomas Matelich. (Jeremy Siek)
// 02 April 2001: Removed limits header altogether. (Jeremy Siek)
// 01 April 2001: Modified to use new <boost/limits.hpp> header. (JMaddock)
//
// See http://www.boost.org/libs/concept_check for documentation.
#ifndef BOOST_CONCEPT_CHECKS_HPP
# define BOOST_CONCEPT_CHECKS_HPP
# include <boost/concept/assert.hpp>
# include <boost/iterator.hpp>
# include <boost/type_traits/conversion_traits.hpp>
# include <utility>
# include <boost/type_traits/is_same.hpp>
# include <boost/type_traits/is_void.hpp>
# include <boost/mpl/assert.hpp>
# include <boost/mpl/bool.hpp>
# include <boost/detail/workaround.hpp>
# include <boost/detail/iterator.hpp>
# include <boost/concept/usage.hpp>
# include <boost/concept/detail/concept_def.hpp>
+#if (defined _MSC_VER)
+# pragma warning( push )
+# pragma warning( disable : 4510 ) // default constructor could not be generated
+# pragma warning( disable : 4610 ) // object 'class' can never be instantiated - user-defined constructor required
+#endif
+
namespace boost
{
//
// Backward compatibility
//
template <class Model>
inline void function_requires(Model* = 0)
{
BOOST_CONCEPT_ASSERT((Model));
}
template <class T> inline void ignore_unused_variable_warning(T const&) {}
# define BOOST_CLASS_REQUIRE(type_var, ns, concept) \
BOOST_CONCEPT_ASSERT((ns::concept<type_var>))
# define BOOST_CLASS_REQUIRE2(type_var1, type_var2, ns, concept) \
BOOST_CONCEPT_ASSERT((ns::concept<type_var1,type_var2>))
# define BOOST_CLASS_REQUIRE3(tv1, tv2, tv3, ns, concept) \
BOOST_CONCEPT_ASSERT((ns::concept<tv1,tv2,tv3>))
# define BOOST_CLASS_REQUIRE4(tv1, tv2, tv3, tv4, ns, concept) \
BOOST_CONCEPT_ASSERT((ns::concept<tv1,tv2,tv3,tv4>))
//
// Begin concept definitions
//
BOOST_concept(Integer, (T))
{
BOOST_CONCEPT_USAGE(Integer)
{
x.error_type_must_be_an_integer_type();
@@ -143,100 +149,92 @@ namespace boost
#endif
const_constraints(b);
}
private:
void const_constraints(const TT& x) {
#if !defined(_ITERATOR_) // back_insert_iterator broken for VC++ STL
a = x; // const required for argument to assignment
#else
ignore_unused_variable_warning(x);
#endif
}
private:
TT a;
TT b;
};
BOOST_concept(CopyConstructible,(TT))
{
BOOST_CONCEPT_USAGE(CopyConstructible) {
TT a(b); // require copy constructor
TT* ptr = &a; // require address of operator
const_constraints(a);
ignore_unused_variable_warning(ptr);
}
private:
void const_constraints(const TT& a) {
TT c(a); // require const copy constructor
const TT* ptr = &a; // require const address of operator
ignore_unused_variable_warning(c);
ignore_unused_variable_warning(ptr);
}
TT b;
};
-#if (defined _MSC_VER)
-# pragma warning( push )
-# pragma warning( disable : 4510 ) // default constructor could not be generated
-# pragma warning( disable : 4610 ) // object 'class' can never be instantiated - user-defined constructor required
-#endif
// The SGI STL version of Assignable requires copy constructor and operator=
BOOST_concept(SGIAssignable,(TT))
{
BOOST_CONCEPT_USAGE(SGIAssignable) {
TT c(a);
#if !defined(_ITERATOR_) // back_insert_iterator broken for VC++ STL
a = b; // require assignment operator
#endif
const_constraints(b);
ignore_unused_variable_warning(c);
}
private:
void const_constraints(const TT& x) {
TT c(x);
#if !defined(_ITERATOR_) // back_insert_iterator broken for VC++ STL
a = x; // const required for argument to assignment
#endif
ignore_unused_variable_warning(c);
}
TT a;
TT b;
};
-#if (defined _MSC_VER)
-# pragma warning( pop )
-#endif
BOOST_concept(Convertible,(X)(Y))
{
BOOST_CONCEPT_USAGE(Convertible) {
Y y = x;
ignore_unused_variable_warning(y);
}
private:
X x;
};
// The C++ standard requirements for many concepts talk about return
// types that must be "convertible to bool". The problem with this
// requirement is that it leaves the door open for evil proxies that
// define things like operator|| with strange return types. Two
// possible solutions are:
// 1) require the return type to be exactly bool
// 2) stay with convertible to bool, and also
// specify stuff about all the logical operators.
// For now we just test for convertible to bool.
template <class TT>
void require_boolean_expr(const TT& t) {
bool x = t;
ignore_unused_variable_warning(x);
}
BOOST_concept(EqualityComparable,(TT))
{
BOOST_CONCEPT_USAGE(EqualityComparable) {
require_boolean_expr(a == b);
require_boolean_expr(a != b);
}
private:
TT a, b;
};
@@ -530,103 +528,103 @@ namespace boost
: Assignable<TT>
{
BOOST_CONCEPT_USAGE(OutputIterator) {
++i; // require preincrement operator
i++; // require postincrement operator
*i++ = t; // require postincrement and assignment
}
private:
TT i, j;
ValueT t;
};
BOOST_concept(ForwardIterator,(TT))
: InputIterator<TT>
{
BOOST_CONCEPT_USAGE(ForwardIterator)
{
BOOST_CONCEPT_ASSERT((Convertible<
BOOST_DEDUCED_TYPENAME ForwardIterator::iterator_category
, std::forward_iterator_tag
>));
typename InputIterator<TT>::reference r = *i;
ignore_unused_variable_warning(r);
}
private:
TT i;
};
BOOST_concept(Mutable_ForwardIterator,(TT))
: ForwardIterator<TT>
{
BOOST_CONCEPT_USAGE(Mutable_ForwardIterator) {
- *i++ = *i; // require postincrement and assignment
+ *i++ = *j; // require postincrement and assignment
}
private:
- TT i;
+ TT i, j;
};
BOOST_concept(BidirectionalIterator,(TT))
: ForwardIterator<TT>
{
BOOST_CONCEPT_USAGE(BidirectionalIterator)
{
BOOST_CONCEPT_ASSERT((Convertible<
BOOST_DEDUCED_TYPENAME BidirectionalIterator::iterator_category
, std::bidirectional_iterator_tag
>));
--i; // require predecrement operator
i--; // require postdecrement operator
}
private:
TT i;
};
BOOST_concept(Mutable_BidirectionalIterator,(TT))
: BidirectionalIterator<TT>
, Mutable_ForwardIterator<TT>
{
BOOST_CONCEPT_USAGE(Mutable_BidirectionalIterator)
{
- *i-- = *i; // require postdecrement and assignment
+ *i-- = *j; // require postdecrement and assignment
}
private:
- TT i;
+ TT i, j;
};
BOOST_concept(RandomAccessIterator,(TT))
: BidirectionalIterator<TT>
, Comparable<TT>
{
BOOST_CONCEPT_USAGE(RandomAccessIterator)
{
BOOST_CONCEPT_ASSERT((Convertible<
BOOST_DEDUCED_TYPENAME BidirectionalIterator<TT>::iterator_category
, std::random_access_iterator_tag
>));
i += n; // require assignment addition operator
i = i + n; i = n + i; // require addition with difference type
i -= n; // require assignment subtraction operator
i = i - n; // require subtraction with difference type
n = i - j; // require difference operator
(void)i[n]; // require element access operator
}
private:
TT a, b;
TT i, j;
typename boost::detail::iterator_traits<TT>::difference_type n;
};
BOOST_concept(Mutable_RandomAccessIterator,(TT))
: RandomAccessIterator<TT>
, Mutable_BidirectionalIterator<TT>
{
BOOST_CONCEPT_USAGE(Mutable_RandomAccessIterator)
{
i[n] = *i; // require element access and assignment
}
@@ -848,71 +846,71 @@ namespace boost
typename S::value_type t;
typename S::size_type n;
typename S::value_type* first, *last;
typename S::iterator p, q;
};
BOOST_concept(FrontInsertionSequence,(S))
: Sequence<S>
{
BOOST_CONCEPT_USAGE(FrontInsertionSequence)
{
c.push_front(t);
c.pop_front();
}
private:
S c;
typename S::value_type t;
};
BOOST_concept(BackInsertionSequence,(S))
: Sequence<S>
{
BOOST_CONCEPT_USAGE(BackInsertionSequence)
{
c.push_back(t);
c.pop_back();
typename BackInsertionSequence::reference r = c.back();
ignore_unused_variable_warning(r);
const_constraints(c);
}
private:
void const_constraints(const S& cc) {
typename BackInsertionSequence::const_reference
r = cc.back();
ignore_unused_variable_warning(r);
- };
+ }
S c;
typename S::value_type t;
};
BOOST_concept(AssociativeContainer,(C))
: ForwardContainer<C>
, DefaultConstructible<C>
{
typedef typename C::key_type key_type;
typedef typename C::key_compare key_compare;
typedef typename C::value_compare value_compare;
typedef typename C::iterator iterator;
BOOST_CONCEPT_USAGE(AssociativeContainer)
{
i = c.find(k);
r = c.equal_range(k);
c.erase(k);
c.erase(i);
c.erase(r.first, r.second);
const_constraints(c);
BOOST_CONCEPT_ASSERT((BinaryPredicate<key_compare,key_type,key_type>));
typedef typename AssociativeContainer::value_type value_type_;
BOOST_CONCEPT_ASSERT((BinaryPredicate<value_compare,value_type_,value_type_>));
}
// Redundant with the base concept, but it helps below.
typedef typename C::const_iterator const_iterator;
private:
void const_constraints(const C& cc)
{
ci = cc.find(k);
n = cc.count(k);
cr = cc.equal_range(k);
@@ -1045,39 +1043,43 @@ namespace boost
{
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& cc) {
ci = cc.begin();
ci = cc.end();
n = cc.size();
b = cc.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
+#if (defined _MSC_VER)
+# pragma warning( pop )
+#endif
+
# include <boost/concept/detail/concept_undef.hpp>
#endif // BOOST_CONCEPT_CHECKS_HPP