Forráskód Böngészése

refactor: template deduction allows us to eschew the ValidatorT trick

Sam Jaffe 3 hónapja
szülő
commit
f3d5274903
2 módosított fájl, 3 hozzáadás és 12 törlés
  1. 1 2
      include/jvalidate/forward.h
  2. 2 10
      include/jvalidate/validator.h

+ 1 - 2
include/jvalidate/forward.h

@@ -173,8 +173,7 @@ template <Adapter A> class ConstraintFactory;
 template <Adapter A> class DocumentCache;
 template <RegexEngine RE> class ValidationVisitor;
 
-template <RegexEngine RE> class ValidatorT;
-class Validator;
+template <RegexEngine RE> class Validator;
 
 template <Adapter A> using URIResolver = bool (*)(URI const &, typename A::value_type &);
 

+ 2 - 10
include/jvalidate/validator.h

@@ -41,7 +41,7 @@ namespace jvalidate {
  *
  * @tparam RE A type that can be used to solve regular expressions
  */
-template <RegexEngine RE = detail::StdRegexEngine> class ValidatorT {
+template <RegexEngine RE = detail::StdRegexEngine> class Validator {
 private:
   schema::Node const & schema_;
   ValidationConfig cfg_;
@@ -56,7 +56,7 @@ public:
    * @param cfg Any special (runtime) configuration rules being applied to the
    * validator.
    */
-  ValidatorT(schema::Node const & schema, ValidationConfig const & cfg = {})
+  Validator(schema::Node const & schema, ValidationConfig const & cfg = {})
       : schema_(schema), cfg_(cfg) {}
 
   /**
@@ -119,12 +119,4 @@ public:
     return validate(adapter::AdapterFor<JSON>(json), result);
   }
 };
-
-/**
- * @brief Syntactic sugar for ValidatorT<>.
- */
-class Validator : public ValidatorT<> {
-public:
-  using Validator::ValidatorT::ValidatorT;
-};
 }