Sort methods.

* data/lalr1-fusion.cc (destroy): Use as() in its definition.
	Define it after as().
This commit is contained in:
Akim Demaille
2008-07-21 21:21:04 +02:00
parent faef34664a
commit 006a030300
2 changed files with 14 additions and 8 deletions

View File

@@ -1,3 +1,9 @@
2008-11-04 Akim Demaille <demaille@gostai.com>
Sort methods.
* data/lalr1-fusion.cc (destroy): Use as() in its definition.
Define it after as().
2008-11-04 Akim Demaille <demaille@gostai.com> 2008-11-04 Akim Demaille <demaille@gostai.com>
Useless parens. Useless parens.

View File

@@ -186,14 +186,6 @@ dnl FIXME: This is wrong, we want computed header guards.
return *new (buffer) T; return *new (buffer) T;
} }
/// Destroy the stored \a T.
template <typename T>
inline void
destroy()
{
reinterpret_cast<T&>(buffer).~T();
}
/// Accessor to a built \a T. /// Accessor to a built \a T.
template <typename T> template <typename T>
inline T& inline T&
@@ -210,6 +202,14 @@ dnl FIXME: This is wrong, we want computed header guards.
return reinterpret_cast<const T&>(buffer); return reinterpret_cast<const T&>(buffer);
} }
/// Destroy the stored \a T.
template <typename T>
inline void
destroy()
{
as<T>().~T();
}
/// A buffer large enough to store any of the semantic values. /// A buffer large enough to store any of the semantic values.
char buffer[S]; char buffer[S];
}; };