mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-11 13:23:04 +00:00
Support constructor with an argument.
This improves the "list" bench by 2%. * data/lalr1.cc (variant::build): Add an overloaded version with an argument. * tests/c++.at (AT_CHECK_VARIANT): Check it.
This commit is contained in:
@@ -247,6 +247,16 @@ dnl FIXME: This is wrong, we want computed header guards.
|
||||
return *new (buffer) T;
|
||||
}
|
||||
|
||||
/// Instantiate a \a T in here from \a t.
|
||||
template <typename T>
|
||||
inline T&
|
||||
build(const T& t)
|
||||
{]b4_assert_if([
|
||||
assert(!built);
|
||||
built = true;])[
|
||||
return *new (buffer) T(t);
|
||||
}
|
||||
|
||||
/// Accessor to a built \a T.
|
||||
template <typename T>
|
||||
inline T&
|
||||
|
||||
Reference in New Issue
Block a user