* data/c++.m4 (basic_symbol): Keep 'inline' in the prototypes, but don't
duplicate it in the implementation.
* data/variant.hh (variant): 'inline' is not needed when the implementation is
provided in the class definition.
// basic_symbol.
template <typename Base>
// basic_symbol.
template <typename Base>
]b4_parser_class_name[::basic_symbol<Base>::basic_symbol ()
: value ()
{}
]b4_locations_if([
template <typename Base>
]b4_parser_class_name[::basic_symbol<Base>::basic_symbol ()
: value ()
{}
]b4_locations_if([
template <typename Base>
]b4_parser_class_name[::basic_symbol<Base>::basic_symbol (const location_type& l)
: value ()
, location (l)
{}])[
template <typename Base>
]b4_parser_class_name[::basic_symbol<Base>::basic_symbol (const location_type& l)
: value ()
, location (l)
{}])[
template <typename Base>
]b4_parser_class_name[::basic_symbol<Base>&
]b4_parser_class_name[::basic_symbol<Base>::operator= (const basic_symbol&)
{
]b4_parser_class_name[::basic_symbol<Base>&
]b4_parser_class_name[::basic_symbol<Base>::operator= (const basic_symbol&)
{
}
template <typename Base>
}
template <typename Base>
]b4_parser_class_name[::basic_symbol<Base>::basic_symbol (const basic_symbol& other)
: Base (other)
, value ()]b4_locations_if([
]b4_parser_class_name[::basic_symbol<Base>::basic_symbol (const basic_symbol& other)
: Base (other)
, value ()]b4_locations_if([
]b4_parser_class_name[::basic_symbol<Base>::basic_symbol (]b4_join(
[typename Base::value_type t],
[const semantic_type& v],
]b4_parser_class_name[::basic_symbol<Base>::basic_symbol (]b4_join(
[typename Base::value_type t],
[const semantic_type& v],
, value ()]b4_locations_if([
, location (l)])[
{
, value ()]b4_locations_if([
, location (l)])[
{
+ // FIXME: The YYUSE macro is only available in the .cc skeleton files. It
+ // is not available in .hh files, where this code is when using %defines.
+ (void) v;
]b4_variant_if([b4_symbol_variant([this->type_get ()], [value], [copy],
[v])],
[value = v;])[
}
template <typename Base>
]b4_variant_if([b4_symbol_variant([this->type_get ()], [value], [copy],
[v])],
[value = v;])[
}
template <typename Base>
]b4_parser_class_name[::basic_symbol<Base>::basic_symbol (]b4_join(
[typename Base::value_type t],
b4_locations_if([const location_type& l]))[)
]b4_parser_class_name[::basic_symbol<Base>::basic_symbol (]b4_join(
[typename Base::value_type t],
b4_locations_if([const location_type& l]))[)
{}
template <typename Base>
{}
template <typename Base>
void
]b4_parser_class_name[::basic_symbol<Base>::move (basic_symbol& s)
{
void
]b4_parser_class_name[::basic_symbol<Base>::move (basic_symbol& s)
{
]b4_parser_class_name[::by_type::by_type ()
: type ()
{}
]b4_parser_class_name[::by_type::by_type ()
: type ()
{}
]b4_parser_class_name[::by_type::by_type (const by_type& other)
: type (other.type)
{}
]b4_parser_class_name[::by_type::by_type (const by_type& other)
: type (other.type)
{}
]b4_parser_class_name[::by_type::by_type (token_type t)
: type (yytranslate_ (t))
{}
]b4_parser_class_name[::by_type::by_type (token_type t)
: type (yytranslate_ (t))
{}
int
]b4_parser_class_name[::by_type::type_get () const
{
return type;
}
]b4_token_ctor_if([[
int
]b4_parser_class_name[::by_type::type_get () const
{
return type;
}
]b4_token_ctor_if([[
]b4_parser_class_name[::token_type
]b4_parser_class_name[::by_type::token () const
{
]b4_parser_class_name[::token_type
]b4_parser_class_name[::by_type::token () const
{
typedef variant<S> self_type;
/// Empty construction.
typedef variant<S> self_type;
/// Empty construction.
variant ()]b4_parse_assert_if([
: built (false)
, tname (YY_NULL)])[
variant ()]b4_parse_assert_if([
: built (false)
, tname (YY_NULL)])[
/// Instantiate a \a T in here.
template <typename T>
/// Instantiate a \a T in here.
template <typename T>
build ()
{]b4_parse_assert_if([
//YYASSERT (!built);
build ()
{]b4_parse_assert_if([
//YYASSERT (!built);
/// Instantiate a \a T in here from \a t.
template <typename T>
/// Instantiate a \a T in here from \a t.
template <typename T>
build (const T& t)
{]b4_parse_assert_if([
//YYASSERT (!built);
build (const T& t)
{]b4_parse_assert_if([
//YYASSERT (!built);
/// Construct and fill.
template <typename T>
/// Construct and fill.
template <typename T>
variant (const T& t)]b4_parse_assert_if([
: built (true)
, tname (typeid (T).name ())])[
variant (const T& t)]b4_parse_assert_if([
: built (true)
, tname (typeid (T).name ())])[
/// Accessor to a built \a T.
template <typename T>
/// Accessor to a built \a T.
template <typename T>
as ()
{]b4_parse_assert_if([
YYASSERT (built);
as ()
{]b4_parse_assert_if([
YYASSERT (built);
/// Const accessor to a built \a T (for %printer).
template <typename T>
/// Const accessor to a built \a T (for %printer).
template <typename T>
as () const
{]b4_parse_assert_if([
YYASSERT (built);
as () const
{]b4_parse_assert_if([
YYASSERT (built);
/// Swapping between built and ((possibly) non-built is done with
/// variant::move ().
template <typename T>
/// Swapping between built and ((possibly) non-built is done with
/// variant::move ().
template <typename T>
swap (variant<S>& other)
{]b4_parse_assert_if([
YYASSERT (built);
swap (variant<S>& other)
{]b4_parse_assert_if([
YYASSERT (built);
/// Assign the content of \a other to this.
/// Destroys \a other.
template <typename T>
/// Assign the content of \a other to this.
/// Destroys \a other.
template <typename T>
move (variant<S>& other)
{]b4_parse_assert_if([
YYASSERT (! built);])[
move (variant<S>& other)
{]b4_parse_assert_if([
YYASSERT (! built);])[
/// Copy the content of \a other to this.
/// Destroys \a other.
template <typename T>
/// Copy the content of \a other to this.
/// Destroys \a other.
template <typename T>
copy (const variant<S>& other)
{
build<T> (other.as<T> ());
copy (const variant<S>& other)
{
build<T> (other.as<T> ());
/// Destroy the stored \a T.
template <typename T>
/// Destroy the stored \a T.
template <typename T>
destroy ()
{
as<T> ().~T ();]b4_parse_assert_if([
destroy ()
{
as<T> ().~T ();]b4_parse_assert_if([