@@ -249,13 +249,13 @@ class INIReader
249249 // Return the list of sections found in ini file
250250 const std::set<std::string>& Sections () const ;
251251
252- template <typename T>
252+ template <typename T = std::string >
253253 T Get (std::string section, std::string name) const ;
254254
255255 template <typename T>
256256 T Get (std::string section, std::string name, T&& default_v) const ;
257257
258- template <typename T>
258+ template <typename T = std::string >
259259 std::vector<T> GetVector (std::string section, std::string name) const ;
260260
261261 template <typename T>
@@ -315,7 +315,7 @@ inline const std::set<std::string>& INIReader::Sections() const
315315 return _sections;
316316}
317317
318- template <typename T>
318+ template <typename T = std::string >
319319inline T INIReader::Get (std::string section, std::string name) const {
320320 std::string key = MakeKey (section, name);
321321 if (!_values.count (key)) {
@@ -351,8 +351,7 @@ inline T INIReader::Get(std::string section, std::string name, T&& default_v) co
351351 return Get<T>(section, name);
352352}
353353
354-
355- template <typename T>
354+ template <typename T = std::string>
356355inline std::vector<T> INIReader::GetVector (std::string section, std::string name) const {
357356 std::string key = MakeKey (section, name);
358357 if (!_values.count (key)) {
@@ -387,6 +386,10 @@ inline std::vector<T> INIReader::GetVector(std::string section, std::string name
387386
388387template <typename T>
389388inline T INIReader::Converter (std::string s) const {
389+ if constexpr (std::is_same<T, std::string>()) {
390+ return s;
391+ }
392+
390393 T v{};
391394 std::istringstream _{s};
392395 _.exceptions (std::ios::failbit);
0 commit comments