Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r61152 - trunk/boost
From: juergen.hunold_at_[hidden]
Date: 2010-04-09 05:04:52


Author: jhunold
Date: 2010-04-09 05:04:51 EDT (Fri, 09 Apr 2010)
New Revision: 61152
URL: http://svn.boost.org/trac/boost/changeset/61152

Log:
Silence gcc warnings when using UnaryFunction with reference parameters.

Text files modified:
   trunk/boost/concept_check.hpp | 10 +++++++++-
   1 files changed, 9 insertions(+), 1 deletions(-)

Modified: trunk/boost/concept_check.hpp
==============================================================================
--- trunk/boost/concept_check.hpp (original)
+++ trunk/boost/concept_check.hpp 2010-04-09 05:04:51 EDT (Fri, 09 Apr 2010)
@@ -330,7 +330,15 @@
       {
           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<YourClassHere>::arg"
+ // in class without a constructor [-Wuninitialized])
+ UnaryFunction();
+#endif
+
       Func f;
       Arg arg;
   };


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk