From 006a0303009d132faef2bdac7dd92b0212a09bd2 Mon Sep 17 00:00:00 2001 From: Akim Demaille Date: Mon, 21 Jul 2008 21:21:04 +0200 Subject: [PATCH 1/1] Sort methods. * data/lalr1-fusion.cc (destroy): Use as() in its definition. Define it after as(). --- ChangeLog | 6 ++++++ data/lalr1-fusion.cc | 16 ++++++++-------- 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/ChangeLog b/ChangeLog index a9be89ff..051dced2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2008-11-04 Akim Demaille + + Sort methods. + * data/lalr1-fusion.cc (destroy): Use as() in its definition. + Define it after as(). + 2008-11-04 Akim Demaille Useless parens. diff --git a/data/lalr1-fusion.cc b/data/lalr1-fusion.cc index bae0c49e..e3cafff8 100644 --- a/data/lalr1-fusion.cc +++ b/data/lalr1-fusion.cc @@ -186,14 +186,6 @@ dnl FIXME: This is wrong, we want computed header guards. return *new (buffer) T; } - /// Destroy the stored \a T. - template - inline void - destroy() - { - reinterpret_cast(buffer).~T(); - } - /// Accessor to a built \a T. template inline T& @@ -210,6 +202,14 @@ dnl FIXME: This is wrong, we want computed header guards. return reinterpret_cast(buffer); } + /// Destroy the stored \a T. + template + inline void + destroy() + { + as().~T(); + } + /// A buffer large enough to store any of the semantic values. char buffer[S]; }; -- 2.45.2