From 5b1f0ac8c2529cb5fa1085a0cac797d937df1119 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Mon, 25 Mar 2024 01:37:13 +0100 Subject: entity: allow readers to const fields --- entity/concepts.hpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'entity') diff --git a/entity/concepts.hpp b/entity/concepts.hpp index 682360dd..e30a2c5e 100644 --- a/entity/concepts.hpp +++ b/entity/concepts.hpp @@ -66,6 +66,11 @@ struct read_field { static constexpr Type read(const Obj& x, Type (Obj::*r)() const) { return (x.*r)(); } }; +template +struct read_field { + static constexpr Type read(const Obj& x, const Type Obj::*r) { return x.*r; } +}; + template struct read_field { static constexpr Type read(const Obj& x, Type Obj::*r) { return x.*r; } -- cgit v1.2.3