Parcourir la source

refactor: require that the schema node outlives the validator

Sam Jaffe il y a 5 mois
Parent
commit
28774f5e80
1 fichiers modifiés avec 2 ajouts et 0 suppressions
  1. 2 0
      include/jvalidate/validator.h

+ 2 - 0
include/jvalidate/validator.h

@@ -59,6 +59,8 @@ public:
   Validator(schema::Node const & schema, ValidationConfig const & cfg = {})
       : schema_(schema), cfg_(cfg) {}
 
+  template <typename... Args> Validator(schema::Node &&, Args &&...) = delete;
+
   /**
    * @brief Run validation on the given JSON
    *