>>99
struct UniqueNumber {
static unsigned int number() { return count(); }
private:
static unsigned int count() { static unsigned int c; return c++; }
}

これでよくない?