8#ifndef model_STATICID_H_
9#define model_STATICID_H_
27 template<
typename Derived>
32 static size_t increment;
36 static bool count_used;
70 std::cout<<
"newCount="<<newCount<<std::endl;
71 std::cout<<
"count="<<count<<std::endl;
72 throw std::runtime_error(
"StaticID::set_count newCount<count");
91 throw std::runtime_error(
"StaticID::set_count newIncrement<1");
98 increment = newIncrement;
102 template<
typename Derived>
103 size_t StaticID<Derived>::increment = 1;
105 template<
typename Derived>
106 size_t StaticID<Derived>::count = 0;
108 template<
typename Derived>
109 bool StaticID<Derived>::count_used =
false;
StaticID(const StaticID &)
static void set_count(const size_t &newCount)
static void force_count(const size_t &newCount)
static size_t & get_count()
const size_t sID
The static ID of this.
static void set_increment(const size_t &newIncrement)