]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Use an explicit cast when need a bool from optional<...>. source/base/parameter_handl... 105/head
authorWolfgang Bangerth <bangerth@math.tamu.edu>
Thu, 21 Aug 2014 18:26:15 +0000 (13:26 -0500)
committerWolfgang Bangerth <bangerth@math.tamu.edu>
Thu, 21 Aug 2014 18:26:15 +0000 (13:26 -0500)
The implicit cast was previously allowed, but newer versions of BOOST together with C++11 mark
the cast as 'explicit', and it fails in the current context.

source/base/parameter_handler.cc

index a81e36349b558b7777a6d2624101e79865808082..4f5f4e35a20112a923e9d3fe31ba2fd336e9a30f 100644 (file)
@@ -1275,7 +1275,7 @@ ParameterHandler::demangle (const std::string &s)
 bool
 ParameterHandler::is_parameter_node (const boost::property_tree::ptree &p)
 {
-  return (p.get_optional<std::string>("value"));
+  return static_cast<bool>(p.get_optional<std::string>("value"));
 }
 
 

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.