From 29fbb6b6959a558a95c8d8bd784cd38c6934fbde Mon Sep 17 00:00:00 2001 From: ToruNiina Date: Wed, 10 Jul 2024 02:39:04 +0900 Subject: [PATCH] feat: enable to convert key char type --- include/toml11/parser.hpp | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) diff --git a/include/toml11/parser.hpp b/include/toml11/parser.hpp index 5952f99..37e4d32 100644 --- a/include/toml11/parser.hpp +++ b/include/toml11/parser.hpp @@ -1693,21 +1693,7 @@ parse_simple_key(location& loc, const context& ctx) if(const auto bare = syntax::unquoted_key(spec).scan(loc)) { - const auto reg = bare.as_string(); - // here we cannot use `if constexpr` because it is C++11. - if(std::is_same::value) - { - return ok(reg); - } - else - { - key_type k; - for(const auto c : reg) - { - k += typename key_type::value_type(c); - } - return ok(k); - } + return ok(to_string_of(bare.as_string())); } else {