diff options
author | Ed Tanous <edtanous@google.com> | 2022-06-06 19:57:26 +0300 |
---|---|---|
committer | Ed Tanous <ed@tanous.net> | 2022-06-30 21:48:06 +0300 |
commit | 4e23a444e8503fd03ab40de2844c783e142ebef8 (patch) | |
tree | f3d9d1fbe5dde9f0d5e1bc23bfb2ac326bf23a4f /http/routing.hpp | |
parent | 69320d54efe41fa5b0947adab5702d9023cc1ee3 (diff) | |
download | bmcweb-4e23a444e8503fd03ab40de2844c783e142ebef8.tar.xz |
Require explicit decorator on one arg constructors
We essentially follow this rule already, not relying on implicit
operators, although there are a number of cases where in theory we
could've implicitly constructed an object.
This commit enables the clang-tidy check.
Tested: Code compiles, passes clang-tidy.
Signed-off-by: Ed Tanous <edtanous@google.com>
Change-Id: Ia428463313b075c69614fdb326e8c5c094e7adde
Diffstat (limited to 'http/routing.hpp')
-rw-r--r-- | http/routing.hpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/http/routing.hpp b/http/routing.hpp index db25433170..3a7b9c2f62 100644 --- a/http/routing.hpp +++ b/http/routing.hpp @@ -30,7 +30,7 @@ namespace crow class BaseRule { public: - BaseRule(const std::string& thisRule) : rule(thisRule) + explicit BaseRule(const std::string& thisRule) : rule(thisRule) {} virtual ~BaseRule() = default; @@ -224,7 +224,7 @@ struct Wrapped template <typename Req, typename... Args> struct ReqHandlerWrapper { - ReqHandlerWrapper(Func fIn) : f(std::move(fIn)) + explicit ReqHandlerWrapper(Func fIn) : f(std::move(fIn)) {} void operator()(const Request& req, @@ -328,7 +328,7 @@ class WebSocketRule : public BaseRule using self_t = WebSocketRule; public: - WebSocketRule(const std::string& ruleIn) : BaseRule(ruleIn) + explicit WebSocketRule(const std::string& ruleIn) : BaseRule(ruleIn) {} void validate() override @@ -467,7 +467,7 @@ struct RuleParameterTraits class DynamicRule : public BaseRule, public RuleParameterTraits<DynamicRule> { public: - DynamicRule(const std::string& ruleIn) : BaseRule(ruleIn) + explicit DynamicRule(const std::string& ruleIn) : BaseRule(ruleIn) {} void validate() override @@ -545,7 +545,7 @@ class TaggedRule : public: using self_t = TaggedRule<Args...>; - TaggedRule(const std::string& ruleIn) : BaseRule(ruleIn) + explicit TaggedRule(const std::string& ruleIn) : BaseRule(ruleIn) {} void validate() override |