Merging fixes to release; fixes #2294 fixes #4918 fixes #3645 refs #2823 refs #1427 refs #2893

[SVN r67792]
This commit is contained in:
Marshall Clow
2011-01-08 18:38:08 +00:00
parent 807fcd7b97
commit 7dec68923d

View File

@@ -72,6 +72,7 @@ namespace boost
T x; T x;
}; };
template <> struct Integer<char> {};
template <> struct Integer<signed char> {}; template <> struct Integer<signed char> {};
template <> struct Integer<unsigned char> {}; template <> struct Integer<unsigned char> {};
template <> struct Integer<short> {}; template <> struct Integer<short> {};
@@ -138,20 +139,21 @@ namespace boost
{ {
BOOST_CONCEPT_USAGE(Assignable) { BOOST_CONCEPT_USAGE(Assignable) {
#if !defined(_ITERATOR_) // back_insert_iterator broken for VC++ STL #if !defined(_ITERATOR_) // back_insert_iterator broken for VC++ STL
a = a; // require assignment operator a = b; // require assignment operator
#endif #endif
const_constraints(a); const_constraints(b);
} }
private: private:
void const_constraints(const TT& b) { void const_constraints(const TT& x) {
#if !defined(_ITERATOR_) // back_insert_iterator broken for VC++ STL #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 #else
ignore_unused_variable_warning(b); ignore_unused_variable_warning(x);
#endif #endif
} }
private: private:
TT a; TT a;
TT b;
}; };
@@ -182,22 +184,23 @@ namespace boost
BOOST_concept(SGIAssignable,(TT)) BOOST_concept(SGIAssignable,(TT))
{ {
BOOST_CONCEPT_USAGE(SGIAssignable) { BOOST_CONCEPT_USAGE(SGIAssignable) {
TT b(a); TT c(a);
#if !defined(_ITERATOR_) // back_insert_iterator broken for VC++ STL #if !defined(_ITERATOR_) // back_insert_iterator broken for VC++ STL
a = a; // require assignment operator a = b; // require assignment operator
#endif #endif
const_constraints(a); const_constraints(b);
ignore_unused_variable_warning(b); ignore_unused_variable_warning(c);
} }
private: private:
void const_constraints(const TT& b) { void const_constraints(const TT& x) {
TT c(b); TT c(x);
#if !defined(_ITERATOR_) // back_insert_iterator broken for VC++ STL #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 #endif
ignore_unused_variable_warning(c); ignore_unused_variable_warning(c);
} }
TT a; TT a;
TT b;
}; };
#if (defined _MSC_VER) #if (defined _MSC_VER)
# pragma warning( pop ) # pragma warning( pop )
@@ -362,6 +365,15 @@ namespace boost
f(first,second); 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; Func f;
First first; First first;
Second second; Second second;
@@ -373,6 +385,15 @@ namespace boost
require_boolean_expr(f(arg)); // require operator() returning bool require_boolean_expr(f(arg)); // require operator() returning bool
} }
private: 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; Func f;
Arg arg; Arg arg;
}; };
@@ -383,6 +404,14 @@ namespace boost
require_boolean_expr(f(a, b)); // require operator() returning bool require_boolean_expr(f(a, b)); // require operator() returning bool
} }
private: 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; Func f;
First a; First a;
Second b; Second b;
@@ -400,6 +429,15 @@ namespace boost
// operator() must be a const member function // operator() must be a const member function
require_boolean_expr(fun(a, b)); 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; Func f;
First a; First a;
Second b; Second b;