diff options
Diffstat (limited to 'entity/accessor.hpp')
-rw-r--r-- | entity/accessor.hpp | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/entity/accessor.hpp b/entity/accessor.hpp index 9836b55f..3b979a16 100644 --- a/entity/accessor.hpp +++ b/entity/accessor.hpp @@ -62,10 +62,13 @@ struct erased_accessor final { {} template<typename T, typename FieldType> - static constexpr bool check_name_static(); + [[nodiscard]] static constexpr bool check_name_static(); template<typename T, typename FieldType> - constexpr bool check_name() const noexcept; + [[nodiscard]] constexpr bool check_name() const noexcept; + + template<typename FieldType> + [[nodiscard]] constexpr bool check_field_name() const noexcept; template<typename Obj> constexpr void do_asserts() const; @@ -109,6 +112,13 @@ constexpr bool erased_accessor::check_name() const noexcept obj == object_type && field == field_type; } +template<typename FieldType> +constexpr bool erased_accessor::check_field_name() const noexcept +{ + constexpr auto name = name_of<FieldType>; + return field_name == name; +} + template<typename Obj, typename FieldType> constexpr void erased_accessor::assert_name() const noexcept { |