mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-09 20:33:03 +00:00
c++: std::to_string is available in C++11
Reported by Victor Khomenko. http://lists.gnu.org/archive/html/bug-bison/2018-10/msg00033.html * doc/bison.texi, examples/c++/variant-11.yy: Use std::to_string instead of ours.
This commit is contained in:
@@ -69,16 +69,6 @@
|
||||
// std::make_unique is C++14.
|
||||
return string_uptr (new std::string{std::forward<Args> (args)...});
|
||||
}
|
||||
|
||||
// Convert to string.
|
||||
template <typename T>
|
||||
std::string
|
||||
to_string (const T& t)
|
||||
{
|
||||
auto&& o = std::ostringstream{};
|
||||
o << t;
|
||||
return o.str ();
|
||||
}
|
||||
}
|
||||
|
||||
%token <string_uptr> TEXT;
|
||||
@@ -103,7 +93,7 @@ list:
|
||||
|
||||
item:
|
||||
TEXT
|
||||
| NUMBER { $$ = make_string_uptr (to_string ($1)); }
|
||||
| NUMBER { $$ = make_string_uptr (std::to_string ($1)); }
|
||||
;
|
||||
%%
|
||||
|
||||
|
||||
Reference in New Issue
Block a user