summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorAkim Demaille <akim.demaille@gmail.com>2018-10-24 18:49:04 +0200
committerAkim Demaille <akim.demaille@gmail.com>2018-10-24 18:49:04 +0200
commit5b879c898002d7e62acd647039aa787fd091e85a (patch)
treebd2efbda7f38551a7f82a6179e8d268ca45a9988 /examples
parent8fd5f0d5a5df946a2782bef5561d967e3a736cd7 (diff)
downloadbison-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.yy12
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)); }
;
%%