* 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 <sanghyeok.oh@samsung.com>
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;
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);
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();
};
}
KdbusConnection &my_connection;
public:
- KdbusConnectionInfo(KdbusConnection &c) : my_connection{c} {}
+ explicit KdbusConnectionInfo(KdbusConnection &c) : my_connection{c} {}
~KdbusConnectionInfo() { release_info(); }
void release_info();