From: sanghyeok.oh Date: Wed, 17 Jul 2019 00:19:21 +0000 (+0900) Subject: change 'constructor with 1 argument' to explicit constructor X-Git-Tag: accepted/tizen/unified/20190724.063739^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=eb752b450f3c1efbb21a7502efc67936e55e6de6;p=platform%2Fcore%2Fsystem%2Flibdbuspolicy.git change 'constructor with 1 argument' to explicit constructor * implicit conversion The compiler is allowed to make one implicit conversion to resolve the parameters to a function. What this means is that the compiler can use constructors callable with a single parameter to convert from one type to another in order to get the right type for a parameter. Change-Id: I79da863d9d86d3ea19e43089f2c836d2f52ef6d8 Signed-off-by: sanghyeok.oh --- diff --git a/src/internal/transaction_guard.hpp b/src/internal/transaction_guard.hpp index 8357459..dec307f 100644 --- a/src/internal/transaction_guard.hpp +++ b/src/internal/transaction_guard.hpp @@ -27,7 +27,7 @@ class Guard { FunRelease fun; bool active; public: - Guard(FunRelease f) : fun(f), active(true) {} + explicit Guard(FunRelease f) : fun(f), active(true) {} Guard() = delete; Guard(const Guard &) = delete; Guard &operator=(const Guard &) = delete; diff --git a/src/internal/tslog.hpp b/src/internal/tslog.hpp index e5ad89f..f028601 100644 --- a/src/internal/tslog.hpp +++ b/src/internal/tslog.hpp @@ -74,7 +74,7 @@ namespace tslog struct print_errno { int err; - print_errno(int e) : err(e) {} + explicit print_errno(int e) : err(e) {} }; std::ostream &operator<<(std::ostream &stream, const print_errno &p); @@ -85,7 +85,7 @@ namespace tslog class LogLock { bool locked; public: - LogLock(ldp_log_level level = ldp_log_level::ERROR); + explicit LogLock(ldp_log_level level = ldp_log_level::ERROR); ~LogLock(); }; } diff --git a/src/kdbus.h b/src/kdbus.h index bf17d5f..22b7ec5 100644 --- a/src/kdbus.h +++ b/src/kdbus.h @@ -62,7 +62,7 @@ class KdbusConnectionInfo { KdbusConnection &my_connection; public: - KdbusConnectionInfo(KdbusConnection &c) : my_connection{c} {} + explicit KdbusConnectionInfo(KdbusConnection &c) : my_connection{c} {} ~KdbusConnectionInfo() { release_info(); } void release_info();