Hi, I'm glad to see that you got around to implementing this - I had toyed with it myself, but with inferior results.
On Mon, Oct 4, 2010 at 4:49 PM, Alex Rousskov <[email protected]> wrote: > + */ > +template <class Class> > +class InstanceId > +{ > +public: > + typedef unsigned int Value; ///< id storage type; \todo: parameterize? Why not use uint32_t? It's defined, and it gives consistent wrapping results > + > + InstanceId(): value(++Last ? Last : ++Last) {} It seems that you don't like object-id 0. Is there any particular reason for this? > + > + operator Value() const { return value; } > + bool operator ==(const InstanceId &o) const { return value == o.value; } > + bool operator !=(const InstanceId &o) const { return !(*this == o); } While these don't hurt, I can't really understand where they could be useful. Are they? Thanks, -- /kinkie
