diff --git a/boost/property_tree/detail/xml_parser_read_rapidxml.hpp b/boost/property_tree/detail/xml_parser_read_rapidxml.hpp index d271d5e..dec810a 100644 --- a/boost/property_tree/detail/xml_parser_read_rapidxml.hpp +++ b/boost/property_tree/detail/xml_parser_read_rapidxml.hpp @@ -118,8 +118,14 @@ namespace boost { namespace property_tree { namespace xml_parser // Swap local and result ptrees pt.swap(local); } catch (rapidxml::parse_error &e) { +#if !defined(BOOST_NO_EXPLICIT_FUNCTION_TEMPLATE_ARGUMENTS) long line = static_cast( std::count(&v.front(), e.where(), Ch('\n')) + 1); +#else + // Can't call 'e.where' to get the line number, so just + // use line 0. + long line = 0; +#endif BOOST_PROPERTY_TREE_THROW( xml_parser_error(e.what(), filename, line)); }