add identificato pattern
This commit is contained in:
19
src/hack/patterns/identificator.hpp
Normal file
19
src/hack/patterns/identificator.hpp
Normal file
@@ -0,0 +1,19 @@
|
||||
#pragma once
|
||||
|
||||
#include <cstddef>
|
||||
|
||||
namespace hack::patterns
|
||||
{
|
||||
template<typename T = std::size_t>
|
||||
class identificator
|
||||
{
|
||||
public:
|
||||
identificator() { m_id = m_counter; ++m_counter; }
|
||||
|
||||
public:
|
||||
T m_id;
|
||||
|
||||
private:
|
||||
static inline T m_counter = 0;
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user