From 3540b3350c6a172b2162c32430248cad2d236898 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Fri, 8 Jan 2021 14:06:26 +0100 Subject: Use auto. --- src/cxml.h | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'src/cxml.h') diff --git a/src/cxml.h b/src/cxml.h index d9c8ef6..2bdde74 100644 --- a/src/cxml.h +++ b/src/cxml.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2012-2019 Carl Hetherington + Copyright (C) 2012-2021 Carl Hetherington This file is part of libcxml. @@ -21,7 +21,6 @@ #ifndef LIBCXML_CXML_H #define LIBCXML_CXML_H -#include #include #include #include @@ -155,7 +154,7 @@ public: template T number_child (std::string c) const { - std::string s = string_child (c); + auto s = string_child (c); boost::erase_all (s, " "); return raw_convert (s); } @@ -163,12 +162,12 @@ public: template boost::optional optional_number_child (std::string c) const { - boost::optional s = optional_string_child (c); + auto s = optional_string_child (c); if (!s) { return boost::optional (); } - std::string t = s.get (); + auto t = s.get (); boost::erase_all (t, " "); return raw_convert (t); } @@ -202,12 +201,12 @@ public: template boost::optional optional_number_attribute (std::string c) const { - boost::optional s = optional_string_attribute (c); + auto s = optional_string_attribute (c); if (!s) { return boost::optional (); } - std::string t = s.get (); + auto t = s.get (); boost::erase_all (t, " "); return raw_convert (t); } -- cgit v1.2.3