mirror of
https://github.com/boostorg/concept_check.git
synced 2025-08-02 14:04:35 +02:00
Comeau port fixes
[SVN r8690]
This commit is contained in:
@@ -12,6 +12,7 @@
|
|||||||
#include <boost/iterator.hpp>
|
#include <boost/iterator.hpp>
|
||||||
#include <utility>
|
#include <utility>
|
||||||
#include <boost/pending/limits.hpp>
|
#include <boost/pending/limits.hpp>
|
||||||
|
#include <boost/static_assert.hpp>
|
||||||
|
|
||||||
#if (__GNUC__) || defined(__KCC) || defined(__ghs) || defined(__MWERKS__)
|
#if (__GNUC__) || defined(__KCC) || defined(__ghs) || defined(__MWERKS__)
|
||||||
#define BOOST_FPTR &
|
#define BOOST_FPTR &
|
||||||
@@ -95,9 +96,10 @@ struct require_same { typedef T type; };
|
|||||||
struct IntegerConcept {
|
struct IntegerConcept {
|
||||||
void constraints() {
|
void constraints() {
|
||||||
#if !defined BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
|
#if !defined BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
|
||||||
errortype_must_be_an_integer_type();
|
x.error_type_not_an_integer();
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
T x;
|
||||||
};
|
};
|
||||||
#if !defined BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
|
#if !defined BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
|
||||||
template <> struct IntegerConcept<short> { void constraints() {} };
|
template <> struct IntegerConcept<short> { void constraints() {} };
|
||||||
@@ -346,6 +348,7 @@ struct require_same { typedef T type; };
|
|||||||
f(arg); // require operator()
|
f(arg); // require operator()
|
||||||
}
|
}
|
||||||
Func f;
|
Func f;
|
||||||
|
Arg arg;
|
||||||
};
|
};
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -590,13 +593,16 @@ struct require_same { typedef T type; };
|
|||||||
void constraints() {
|
void constraints() {
|
||||||
function_requires< InputIteratorConcept<const_iterator> >();
|
function_requires< InputIteratorConcept<const_iterator> >();
|
||||||
function_requires< AssignableConcept<Container> >();
|
function_requires< AssignableConcept<Container> >();
|
||||||
const Container c;
|
const_constraints(c);
|
||||||
|
}
|
||||||
|
void const_constraints(const Container& c) {
|
||||||
i = c.begin();
|
i = c.begin();
|
||||||
i = c.end();
|
i = c.end();
|
||||||
n = c.size();
|
n = c.size();
|
||||||
n = c.max_size();
|
n = c.max_size();
|
||||||
b = c.empty();
|
b = c.empty();
|
||||||
}
|
}
|
||||||
|
Container c;
|
||||||
bool b;
|
bool b;
|
||||||
const_iterator i;
|
const_iterator i;
|
||||||
size_type n;
|
size_type n;
|
||||||
@@ -654,12 +660,15 @@ struct require_same { typedef T type; };
|
|||||||
void constraints() {
|
void constraints() {
|
||||||
function_requires< ForwardContainerConcept<ReversibleContainer> >();
|
function_requires< ForwardContainerConcept<ReversibleContainer> >();
|
||||||
function_requires< BidirectionalIteratorConcept<const_iterator> >();
|
function_requires< BidirectionalIteratorConcept<const_iterator> >();
|
||||||
function_requires< BidirectionalIteratorConcept<const_reverse_iterator> >();
|
function_requires<
|
||||||
|
BidirectionalIteratorConcept<const_reverse_iterator> >();
|
||||||
const ReversibleContainer c;
|
const_constraints(c);
|
||||||
|
}
|
||||||
|
void const_constraints(const ReversibleContainer& c) {
|
||||||
const_reverse_iterator i = c.rbegin();
|
const_reverse_iterator i = c.rbegin();
|
||||||
i = c.rend();
|
i = c.rend();
|
||||||
}
|
}
|
||||||
|
ReversibleContainer c;
|
||||||
};
|
};
|
||||||
|
|
||||||
template <class ReversibleContainer>
|
template <class ReversibleContainer>
|
||||||
@@ -670,9 +679,11 @@ struct require_same { typedef T type; };
|
|||||||
|
|
||||||
void constraints() {
|
void constraints() {
|
||||||
function_requires< ReversibleContainerConcept<ReversibleContainer> >();
|
function_requires< ReversibleContainerConcept<ReversibleContainer> >();
|
||||||
function_requires< Mutable_ForwardContainerConcept<ReversibleContainer> >();
|
function_requires<
|
||||||
|
Mutable_ForwardContainerConcept<ReversibleContainer> >();
|
||||||
function_requires< Mutable_BidirectionalIteratorConcept<iterator> >();
|
function_requires< Mutable_BidirectionalIteratorConcept<iterator> >();
|
||||||
function_requires< Mutable_BidirectionalIteratorConcept<reverse_iterator> >();
|
function_requires<
|
||||||
|
Mutable_BidirectionalIteratorConcept<reverse_iterator> >();
|
||||||
|
|
||||||
reverse_iterator i = c.rbegin();
|
reverse_iterator i = c.rbegin();
|
||||||
i = c.rend();
|
i = c.rend();
|
||||||
@@ -692,12 +703,16 @@ struct require_same { typedef T type; };
|
|||||||
void constraints() {
|
void constraints() {
|
||||||
function_requires< ReversibleContainerConcept<RandomAccessContainer> >();
|
function_requires< ReversibleContainerConcept<RandomAccessContainer> >();
|
||||||
function_requires< RandomAccessIteratorConcept<const_iterator> >();
|
function_requires< RandomAccessIteratorConcept<const_iterator> >();
|
||||||
function_requires< RandomAccessIteratorConcept<const_reverse_iterator> >();
|
function_requires<
|
||||||
|
RandomAccessIteratorConcept<const_reverse_iterator> >();
|
||||||
|
|
||||||
const RandomAccessContainer c;
|
const_constraints(c);
|
||||||
|
}
|
||||||
|
void const_constraits(const RandomAccessContainer& c) {
|
||||||
const_reference r = c[n];
|
const_reference r = c[n];
|
||||||
ignore_unused_variable_warning(r);
|
ignore_unused_variable_warning(r);
|
||||||
}
|
}
|
||||||
|
RandomAccessContainer c;
|
||||||
size_type n;
|
size_type n;
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -710,10 +725,13 @@ struct require_same { typedef T type; };
|
|||||||
typedef typename RandomAccessContainer::reverse_iterator reverse_iterator;
|
typedef typename RandomAccessContainer::reverse_iterator reverse_iterator;
|
||||||
|
|
||||||
void constraints() {
|
void constraints() {
|
||||||
function_requires< RandomAccessContainerConcept<RandomAccessContainer> >();
|
function_requires<
|
||||||
function_requires< Mutable_ReversibleContainerConcept<RandomAccessContainer> >();
|
RandomAccessContainerConcept<RandomAccessContainer> >();
|
||||||
|
function_requires<
|
||||||
|
Mutable_ReversibleContainerConcept<RandomAccessContainer> >();
|
||||||
function_requires< Mutable_RandomAccessIteratorConcept<iterator> >();
|
function_requires< Mutable_RandomAccessIteratorConcept<iterator> >();
|
||||||
function_requires< Mutable_RandomAccessIteratorConcept<reverse_iterator> >();
|
function_requires<
|
||||||
|
Mutable_RandomAccessIteratorConcept<reverse_iterator> >();
|
||||||
|
|
||||||
reference r = c[i];
|
reference r = c[i];
|
||||||
ignore_unused_variable_warning(r);
|
ignore_unused_variable_warning(r);
|
||||||
|
Reference in New Issue
Block a user