jimmy_c 发表于 2013-1-27 05:28:28

greta在vc express 2008下编译失败

支持vc6和vs.net。在2008下产生C2923。
似乎是原有hetero_stack::stack_node::header结构现在不能看作类型了。

将原有code
struct stack_node{    struct header    {      stack_node * m_back;      stack_node * m_next;      byte_t   * m_current; // ptr into m_mem. alloc from here      byte_t   * m_end;   // ptr to last+1 byte_t in m_mem    };    union    {      headerm_head;      byte_tm_align[ aligned_sizeof<header>::no_rtti ];    };    // This is the buffer into which values will be pushed and popped.    // It is guaranteed to meet the AlignmentT requirements because of    // the union above.    byte_tm_mem;    size_t size() const // throw()    {      return static_cast<size_t>( m_head.m_end - m_mem );    }};
改为
struct stack_node_header;struct stack_node{    union    {      stack_node_headerm_head;      byte_tm_align[ aligned_sizeof<stack_node_header>::no_rtti ];    };    // This is the buffer into which values will be pushed and popped.    // It is guaranteed to meet the AlignmentT requirements because of    // the union above.    byte_tm_mem;    size_t size() const // throw()    {      return static_cast<size_t>( m_head.m_end - m_mem );    }};struct stack_node_header{    stack_node * m_back;    stack_node * m_next;    byte_t   * m_current; // ptr into m_mem. alloc from here    byte_t   * m_end;   // ptr to last+1 byte_t in m_mem};
并将引用:
byte_t      m_buf[ aligned_sizeof<stack_node::header>::no_rtti + StaticBlockSizeT ];
改为:
byte_t      m_buf[ aligned_sizeof<stack_node_header>::no_rtti + StaticBlockSizeT ];
编译通过。
页: [1]
查看完整版本: greta在vc express 2008下编译失败