size:size(<a><b>foo</b></a>) returns 101. This is wrong because just 
sizeof(ElementNode) is 52 and the tree <a><b>foo</b></a> consists of 2 element 
nodes, one text node and one (hidden) attribute node. 

The reason for this wrong result is in this struct:

template<typename T>
struct size_traits<T*,false> {
  static size_t alloc_sizeof( T *p ) {
    return p ? mem_sizeof( *p ) : 0;

Basically, an InternalNode has a vector of XmlNode*. So, the above struct is 
instantiated with T being XmlNode. Then, mem_sizeof(XmlNode) is called 
returning just 20 (== sizeof(XmlNode)).

Your team Zorba Coders is subscribed to branch lp:zorba.

Mailing list:
Post to     :
Unsubscribe :
More help   :

Reply via email to