From 8b9c89fb65d758e99602c068e16bfbf109437e42 Mon Sep 17 00:00:00 2001 From: Akim Demaille Date: Fri, 18 Jul 2008 18:37:40 +0200 Subject: [PATCH] Let yy::variant::build return an lvalue. * 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 b69409c7..0400e19c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2008-11-03 Akim Demaille + + Let yy::variant::build return an lvalue. + * data/lalr1-fusion.cc (variant::build): Return a reference to the + object. + 2008-11-03 Akim Demaille Define yy::variant only when needed. diff --git a/data/lalr1-fusion.cc b/data/lalr1-fusion.cc index ca5da6a5..3a629aaf 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 - inline void + inline T& build() { - new (buffer) T; + return *new (buffer) T; } /// Destroy the stored \a T. -- 2.50.0