From 74f53b444853850144c3e63593f83c424e84a768 Mon Sep 17 00:00:00 2001 From: Paul Cristian Sarbu Date: Thu, 4 Jul 2024 11:21:11 +0200 Subject: Mark more constructors 'explicit' Since c++17 the 'explicit' keyword has use also for constructors with more than one argument and it is recommended to use it by default whereever implicit conversions are not expected bahaviour. --- src/buildtool/execution_api/local/local_action.hpp | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'src/buildtool/execution_api/local/local_action.hpp') diff --git a/src/buildtool/execution_api/local/local_action.hpp b/src/buildtool/execution_api/local/local_action.hpp index 0fce3c35..b88b3a97 100644 --- a/src/buildtool/execution_api/local/local_action.hpp +++ b/src/buildtool/execution_api/local/local_action.hpp @@ -67,13 +67,14 @@ class LocalAction final : public IExecutionAction { std::chrono::milliseconds timeout_{kDefaultTimeout}; CacheFlag cache_flag_{CacheFlag::CacheOutput}; - LocalAction(gsl::not_null const& storage, - ArtifactDigest root_digest, - std::vector command, - std::vector output_files, - std::vector output_dirs, - std::map env_vars, - std::map const& properties) noexcept + explicit LocalAction( + gsl::not_null const& storage, + ArtifactDigest root_digest, + std::vector command, + std::vector output_files, + std::vector output_dirs, + std::map env_vars, + std::map const& properties) noexcept : storage_{storage}, root_digest_{std::move(root_digest)}, cmdline_{std::move(command)}, -- cgit v1.2.3