- Как работает эта двойная статическая штука?
- Есть ли лучший и более простой способ сделать это?
Код: Выделить всё
#include
#include
#include
struct Physics_c {};
struct Render_c {};
struct Collision_c {};
using componentID = std::size_t;
const inline componentID getID() noexcept {
static componentID lastID = 0;
return lastID++;
}
template
const inline componentID gettypeID() noexcept{
std::cout
Подробнее здесь: [url]https://stackoverflow.com/questions/78662209/static-variable-and-type-could-there-be-another-simpler-way-to-implement-a-func[/url]