forked from boostorg/concept_check
[SVN r67792]
This commit is contained in:
@@ -72,6 +72,7 @@ namespace boost
|
||||
T x;
|
||||
};
|
||||
|
||||
template <> struct Integer<char> {};
|
||||
template <> struct Integer<signed char> {};
|
||||
template <> struct Integer<unsigned char> {};
|
||||
template <> struct Integer<short> {};
|
||||
@@ -138,20 +139,21 @@ namespace boost
|
||||
{
|
||||
BOOST_CONCEPT_USAGE(Assignable) {
|
||||
#if !defined(_ITERATOR_) // back_insert_iterator broken for VC++ STL
|
||||
a = a; // require assignment operator
|
||||
a = b; // require assignment operator
|
||||
#endif
|
||||
const_constraints(a);
|
||||
const_constraints(b);
|
||||
}
|
||||
private:
|
||||
void const_constraints(const TT& b) {
|
||||
void const_constraints(const TT& x) {
|
||||
#if !defined(_ITERATOR_) // back_insert_iterator broken for VC++ STL
|
||||
a = b; // const required for argument to assignment
|
||||
a = x; // const required for argument to assignment
|
||||
#else
|
||||
ignore_unused_variable_warning(b);
|
||||
ignore_unused_variable_warning(x);
|
||||
#endif
|
||||
}
|
||||
private:
|
||||
TT a;
|
||||
TT b;
|
||||
};
|
||||
|
||||
|
||||
@@ -182,22 +184,23 @@ namespace boost
|
||||
BOOST_concept(SGIAssignable,(TT))
|
||||
{
|
||||
BOOST_CONCEPT_USAGE(SGIAssignable) {
|
||||
TT b(a);
|
||||
TT c(a);
|
||||
#if !defined(_ITERATOR_) // back_insert_iterator broken for VC++ STL
|
||||
a = a; // require assignment operator
|
||||
a = b; // require assignment operator
|
||||
#endif
|
||||
const_constraints(a);
|
||||
ignore_unused_variable_warning(b);
|
||||
const_constraints(b);
|
||||
ignore_unused_variable_warning(c);
|
||||
}
|
||||
private:
|
||||
void const_constraints(const TT& b) {
|
||||
TT c(b);
|
||||
void const_constraints(const TT& x) {
|
||||
TT c(x);
|
||||
#if !defined(_ITERATOR_) // back_insert_iterator broken for VC++ STL
|
||||
a = b; // const required for argument to assignment
|
||||
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 )
|
||||
@@ -362,6 +365,15 @@ namespace boost
|
||||
f(first,second);
|
||||
}
|
||||
|
||||
#if (BOOST_WORKAROUND(__GNUC__, BOOST_TESTED_AT(4) \
|
||||
&& BOOST_WORKAROUND(__GNUC__, > 3)))
|
||||
// Declare a dummy constructor to make gcc happy.
|
||||
// It seems the compiler can not generate a sensible constructor when this is instantiated with a refence type.
|
||||
// (warning: non-static reference "const double& boost::BinaryFunction<YourClassHere>::arg"
|
||||
// in class without a constructor [-Wuninitialized])
|
||||
BinaryFunction();
|
||||
#endif
|
||||
|
||||
Func f;
|
||||
First first;
|
||||
Second second;
|
||||
@@ -373,6 +385,15 @@ namespace boost
|
||||
require_boolean_expr(f(arg)); // require operator() returning bool
|
||||
}
|
||||
private:
|
||||
#if (BOOST_WORKAROUND(__GNUC__, BOOST_TESTED_AT(4) \
|
||||
&& BOOST_WORKAROUND(__GNUC__, > 3)))
|
||||
// Declare a dummy constructor to make gcc happy.
|
||||
// It seems the compiler can not generate a sensible constructor when this is instantiated with a refence type.
|
||||
// (warning: non-static reference "const double& boost::UnaryPredicate<YourClassHere>::arg"
|
||||
// in class without a constructor [-Wuninitialized])
|
||||
UnaryPredicate();
|
||||
#endif
|
||||
|
||||
Func f;
|
||||
Arg arg;
|
||||
};
|
||||
@@ -383,6 +404,14 @@ namespace boost
|
||||
require_boolean_expr(f(a, b)); // require operator() returning bool
|
||||
}
|
||||
private:
|
||||
#if (BOOST_WORKAROUND(__GNUC__, BOOST_TESTED_AT(4) \
|
||||
&& BOOST_WORKAROUND(__GNUC__, > 3)))
|
||||
// Declare a dummy constructor to make gcc happy.
|
||||
// It seems the compiler can not generate a sensible constructor when this is instantiated with a refence type.
|
||||
// (warning: non-static reference "const double& boost::BinaryPredicate<YourClassHere>::arg"
|
||||
// in class without a constructor [-Wuninitialized])
|
||||
BinaryPredicate();
|
||||
#endif
|
||||
Func f;
|
||||
First a;
|
||||
Second b;
|
||||
@@ -400,6 +429,15 @@ namespace boost
|
||||
// operator() must be a const member function
|
||||
require_boolean_expr(fun(a, b));
|
||||
}
|
||||
#if (BOOST_WORKAROUND(__GNUC__, BOOST_TESTED_AT(4) \
|
||||
&& BOOST_WORKAROUND(__GNUC__, > 3)))
|
||||
// Declare a dummy constructor to make gcc happy.
|
||||
// It seems the compiler can not generate a sensible constructor when this is instantiated with a refence type.
|
||||
// (warning: non-static reference "const double& boost::Const_BinaryPredicate<YourClassHere>::arg"
|
||||
// in class without a constructor [-Wuninitialized])
|
||||
Const_BinaryPredicate();
|
||||
#endif
|
||||
|
||||
Func f;
|
||||
First a;
|
||||
Second b;
|
||||
|
Reference in New Issue
Block a user