diff options
author | Akim Demaille <akim.demaille@gmail.com> | 2018-10-24 18:49:04 +0200 |
---|---|---|
committer | Akim Demaille <akim.demaille@gmail.com> | 2018-10-24 18:49:04 +0200 |
commit | 5b879c898002d7e62acd647039aa787fd091e85a (patch) | |
tree | bd2efbda7f38551a7f82a6179e8d268ca45a9988 /examples | |
parent | 8fd5f0d5a5df946a2782bef5561d967e3a736cd7 (diff) | |
download | bison-5b879c898002d7e62acd647039aa787fd091e85a.tar.gz |
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.
Diffstat (limited to 'examples')
-rw-r--r-- | examples/c++/variant-11.yy | 12 |
1 files changed, 1 insertions, 11 deletions
diff --git a/examples/c++/variant-11.yy b/examples/c++/variant-11.yy index 4cd581ca..be38589d 100644 --- a/examples/c++/variant-11.yy +++ b/examples/c++/variant-11.yy @@ -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)); } ; %% |