summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAkim Demaille <demaille@gostai.com>2011-01-10 20:25:27 +0100
committerAkim Demaille <demaille@gostai.com>2011-06-30 10:52:29 +0200
commitb98a83eaf2f700abb65451614552853457f6adac (patch)
treeb2482aaf9fcad154263cd8fdf7e468eb06a6bb08
parent720c088eb3865292fb9b3efff405ff8cb3935a6f (diff)
downloadbison-b98a83eaf2f700abb65451614552853457f6adac.tar.gz
variant: reorder.
* data/variant.hh: Leave the buffer first. Remove debugging code.
-rw-r--r--data/variant.hh18
1 files changed, 8 insertions, 10 deletions
diff --git a/data/variant.hh b/data/variant.hh
index 76d4df68..37801031 100644
--- a/data/variant.hh
+++ b/data/variant.hh
@@ -90,12 +90,7 @@ m4_define([b4_variant_define],
/// via the current state.
template <size_t S>
struct variant
- {]b4_parse_assert_if([
- /// Whether something is contained.
- bool built;
- /// If defined, the name of the stored type.
- const char* tname;
-])[
+ {
/// Type of *this.
typedef variant<S> self_type;
@@ -188,7 +183,6 @@ m4_define([b4_variant_define],
inline void
build (variant<S>& other)
{
- std::cerr << "STEAL" << std::endl;
build<T>();
swap<T>(other);
other.destroy<T>();
@@ -200,7 +194,6 @@ m4_define([b4_variant_define],
inline void
copy (const variant<S>& other)
{
- std::cerr << "COPY" << std::endl;
build<T>(other.as<T>());
}
@@ -220,7 +213,8 @@ m4_define([b4_variant_define],
{
abort();
}
-
+
+ private:
/// A buffer large enough to store any of the semantic values.
/// Long double is chosen as it has the strongest alignment
/// constraints.
@@ -228,7 +222,11 @@ m4_define([b4_variant_define],
{
long double align_me;
char raw[S];
- } buffer;
+ } buffer;]b4_parse_assert_if([
+ /// Whether something is contained.
+ bool built;
+ /// If defined, the name of the stored type.
+ const char* tname;])[
};
]])