From e8cc64a9a7944087aabc60c844dd64e5a7318268 Mon Sep 17 00:00:00 2001 From: artemp Date: Tue, 15 Jan 2013 14:14:08 +0000 Subject: [PATCH] + fast_cast to mapnik::boolean specialization --- src/xml_tree.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/xml_tree.cpp b/src/xml_tree.cpp index 5729a9ea9..651a3d147 100644 --- a/src/xml_tree.cpp +++ b/src/xml_tree.cpp @@ -56,6 +56,15 @@ inline boost::optional fast_cast(xml_tree const& tree, std::string const& val } } +template <> +inline boost::optional fast_cast(xml_tree const& tree, std::string const& value) +{ + bool result; + if (mapnik::util::string2bool(value, result)) + return boost::optional(result); + return boost::optional(); +} + template <> inline boost::optional fast_cast(xml_tree const& tree, std::string const& value) {