summaryrefslogtreecommitdiffhomepage
path: root/entity/accessor.hpp
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2022-11-18 12:04:26 +0100
committerStanislaw Halik <sthalik@misaki.pl>2022-11-18 12:30:17 +0100
commit50d4d02508767ed3cb67bf1ed424c61c23e44117 (patch)
tree62e2cb6c4277877cfe68c01d36fb679e69d2403d /entity/accessor.hpp
parent44b40de7fc70fe81757a0288422de1953a2f98cb (diff)
entity: add read-only property support
Diffstat (limited to 'entity/accessor.hpp')
-rw-r--r--entity/accessor.hpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/entity/accessor.hpp b/entity/accessor.hpp
index 9b836420..a097afd4 100644
--- a/entity/accessor.hpp
+++ b/entity/accessor.hpp
@@ -40,6 +40,7 @@ struct erased_accessor final {
template<typename Obj, typename FieldType> requires std::is_default_constructible_v<FieldType> FieldType read(const Obj& x) const noexcept;
template<typename Obj, typename FieldType> void read(const Obj& x, FieldType& value) const noexcept;
template<typename Obj, typename FieldType> void write(Obj& x, move_qualified<FieldType> value) const noexcept;
+ constexpr bool can_write() const noexcept { return writer != nullptr; }
};
template<typename T, typename FieldType>