Browse Source

snapshot: check registry type

Michele Caini 2 years ago
parent
commit
2d25bbb090
1 changed files with 3 additions and 0 deletions
  1. 3 0
      src/entt/entity/snapshot.hpp

+ 3 - 0
src/entt/entity/snapshot.hpp

@@ -28,6 +28,7 @@ namespace entt {
  */
  */
 template<typename Registry>
 template<typename Registry>
 class basic_snapshot {
 class basic_snapshot {
+    static_assert(!std::is_const_v<Registry>, "Non-const registry type required");
     using traits_type = typename Registry::traits_type;
     using traits_type = typename Registry::traits_type;
 
 
 public:
 public:
@@ -170,6 +171,7 @@ private:
  */
  */
 template<typename Registry>
 template<typename Registry>
 class basic_snapshot_loader {
 class basic_snapshot_loader {
+    static_assert(!std::is_const_v<Registry>, "Non-const registry type required");
     using traits_type = typename Registry::traits_type;
     using traits_type = typename Registry::traits_type;
 
 
 public:
 public:
@@ -313,6 +315,7 @@ private:
  */
  */
 template<typename Registry>
 template<typename Registry>
 class basic_continuous_loader {
 class basic_continuous_loader {
+    static_assert(!std::is_const_v<Registry>, "Non-const registry type required");
     using traits_type = typename Registry::traits_type;
     using traits_type = typename Registry::traits_type;
 
 
     void restore(typename Registry::entity_type entt) {
     void restore(typename Registry::entity_type entt) {