Eliminate warnings from BinaryFunction, UnaryPredicate, BinaryPredicate concept check classes.

[SVN r67422]
This commit is contained in:
Neil Groves
2010-12-23 00:43:10 +00:00
parent f81493caa1
commit b4ff615db8

View File

@ -363,6 +363,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;
@ -374,6 +383,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;
};
@ -384,6 +402,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;
@ -401,6 +427,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;