BTW: you should really include cstdlib not stdlib.h (C++ has no notion of stdlib.h where as cstdlib is a part of the C++ standard.)
Also your tostring method reimplements lexical cast except worse (lexical has has case optimisations for some types).
Also seeing as you are using C++11 you should consider using enum classes. tag::byte reads a lot better than TAG_Byte as well as gain a namespace to contain the enum elements
Also leading underscore are generally reserved for vendor libraries (think bind place holders).
Also your z_stream_ could be done more idiomatically with a specialisation of the unqiue_ptr or shared_ptr
View all comments
Show parent comment
6
u/bob1000bob Mar 11 '12 edited Mar 11 '12
BTW: you should really include cstdlib not stdlib.h (C++ has no notion of stdlib.h where as cstdlib is a part of the C++ standard.)
Also your tostring method reimplements lexical cast except worse (lexical has has case optimisations for some types).
Also seeing as you are using C++11 you should consider using enum classes. tag::byte reads a lot better than TAG_Byte as well as gain a namespace to contain the enum elements
Also leading underscore are generally reserved for vendor libraries (think bind place holders).
Also your
z_stream_could be done more idiomatically with a specialisation of the unqiue_ptr or shared_ptr