bison-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] Let yy::variant::build return an lvalue.


From: Akim Demaille
Subject: [PATCH] Let yy::variant::build return an lvalue.
Date: Mon, 03 Nov 2008 21:01:22 -0000

        * data/lalr1-fusion.cc (variant::build): Return a reference to the
        object.
---
 ChangeLog            |    6 ++++++
 data/lalr1-fusion.cc |    4 ++--
 2 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index b69409c..0400e19 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,11 @@
 2008-11-03  Akim Demaille  <address@hidden>
 
+       Let yy::variant::build return an lvalue.
+       * data/lalr1-fusion.cc (variant::build): Return a reference to the
+       object.
+
+2008-11-03  Akim Demaille  <address@hidden>
+
        Define yy::variant only when needed.
        * data/lalr1-fusion.cc (yy::variant): Define only if variants are
        used.
diff --git a/data/lalr1-fusion.cc b/data/lalr1-fusion.cc
index ca5da6a..3a629aa 100644
--- a/data/lalr1-fusion.cc
+++ b/data/lalr1-fusion.cc
@@ -167,10 +167,10 @@ dnl FIXME: This is wrong, we want computed header guards.
   {
     /// Instantiate a \a T in here.
     template <typename T>
-    inline void
+    inline T&
     build()
     {
-      new (buffer) T;
+      return *new (buffer) T;
     }
 
     /// Destroy the stored \a T.
-- 
1.6.0.2.588.g3102





reply via email to

[Prev in Thread] Current Thread [Next in Thread]