From 0eac9e329b81dfe765f0bce040a8d3c4c1d7a807 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrgen=20Hunold?= Date: Fri, 9 Apr 2010 09:04:51 +0000 Subject: [PATCH] Silence gcc warnings when using UnaryFunction with reference parameters. [SVN r61152] --- include/boost/concept_check.hpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/include/boost/concept_check.hpp b/include/boost/concept_check.hpp index 12ec2ad..f051c72 100644 --- a/include/boost/concept_check.hpp +++ b/include/boost/concept_check.hpp @@ -330,7 +330,15 @@ namespace boost { f(arg); } - + +#if BOOST_WORKAROUND(__GNUC__, BOOST_TESTED_AT(4)) + // Declare a dummy construktor 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::UnaryFunction::arg" + // in class without a constructor [-Wuninitialized]) + UnaryFunction(); +#endif + Func f; Arg arg; };