Interface of a variant-like class
Couple of things I noticed:

The serialize members:

void read(std::istream&amp; stream);
void write(std::ostream&amp; stream);


I don't particular mind them but I also would prefer to have operator&lt;&lt; and operator&gt;&gt; defined (Note you can simply make these call write/read respectively).

With the stream iterators defined this becomes less useful.

void print(int indent = 0);


The following seem like very simialer.

int8_t byteValue() const;
int16_t shortValue() const;
int32_t intValue() const;
int64_t longValue() const;
float floatValue() const;
double doubleValue() const;
ByteArray byteArrayValue() const;
IntArray intArrayValue() const;
UTF8String stringValue() const;


I think we can replace all of them with:

template&lt;typename T&gt;
T const&amp; get() const;


I like this better as we do not need to guess that byte maps to int8_t or short maps to int16_t as we can explicitly get the type we want:

 int8_t  val = t.get&lt;int8_t&gt;();


But there is already something very similar defined in boost:

boost::any