From fc69e91636052670bea44447fe3236713c2b778f Mon Sep 17 00:00:00 2001 From: Michele Caini Date: Tue, 13 Apr 2021 11:51:50 +0200 Subject: [PATCH] test: refined custom id example --- test/example/custom_identifier.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/test/example/custom_identifier.cpp b/test/example/custom_identifier.cpp index 88ece452a..824807aa6 100644 --- a/test/example/custom_identifier.cpp +++ b/test/example/custom_identifier.cpp @@ -5,16 +5,17 @@ struct entity_id { using entity_type = typename entt::entt_traits::entity_type; + static constexpr auto null = entt::null; - entity_id(entity_type value = entt::null) + constexpr entity_id(entity_type value = null) : entt{value} {} - entity_id(const entity_id &other) + constexpr entity_id(const entity_id &other) : entt{other.entt} {} - operator entity_type() const { + constexpr operator entity_type() const { return entt; }