mirror of
https://github.com/BlackMATov/meta.hpp.git
synced 2025-12-15 11:52:08 +07:00
family id atomic generator
This commit is contained in:
@@ -8,6 +8,7 @@
|
|||||||
|
|
||||||
#include <any>
|
#include <any>
|
||||||
#include <array>
|
#include <array>
|
||||||
|
#include <atomic>
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
#include <cstddef>
|
#include <cstddef>
|
||||||
#include <cstdint>
|
#include <cstdint>
|
||||||
@@ -60,9 +61,12 @@ namespace meta_hpp
|
|||||||
std::is_void_v<Void>,
|
std::is_void_v<Void>,
|
||||||
"unexpected internal error");
|
"unexpected internal error");
|
||||||
protected:
|
protected:
|
||||||
static family_id::underlying_type last_id_;
|
static std::atomic<family_id::underlying_type> last_id_;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
template < typename Void >
|
||||||
|
std::atomic<family_id::underlying_type> family_base<Void>::last_id_{};
|
||||||
|
|
||||||
template < typename T >
|
template < typename T >
|
||||||
class type_family final : public family_base<> {
|
class type_family final : public family_base<> {
|
||||||
public:
|
public:
|
||||||
@@ -82,9 +86,6 @@ namespace meta_hpp
|
|||||||
return self_id;
|
return self_id;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
template < typename Void >
|
|
||||||
family_id::underlying_type family_base<Void>::last_id_{};
|
|
||||||
}
|
}
|
||||||
|
|
||||||
template < typename T >
|
template < typename T >
|
||||||
|
|||||||
Reference in New Issue
Block a user