Fix overload for Executor ctor calls with brace-initializers

PiperOrigin-RevId: 354319778
Change-Id: I7b47ef2de734683f9168ef80f8b29357532d51ff
pull/83/head
Wiktor Garbacz 2021-01-28 08:42:35 -08:00 committed by Copybara-Service
parent ec870c3d15
commit 552a510777
1 changed files with 6 additions and 0 deletions

View File

@ -55,6 +55,9 @@ class Executor final {
}
// As above, but with `const std::vector<std::string>&`
// Templated to avoid ambiguity with the absl::Span overloads when called
// with brace-initializers.
template <typename = void>
Executor(absl::string_view path, const std::vector<std::string>& argv,
const std::vector<std::string>& envp = CopyEnviron())
: Executor(path, absl::MakeSpan(argv), absl::MakeSpan(envp)) {}
@ -71,6 +74,9 @@ class Executor final {
}
// As above, but with `const std::vector<std::string>&`
// Templated to avoid ambiguity with the absl::Span overloads when called
// with brace-initializers.
template <typename = void>
Executor(int exec_fd, const std::vector<std::string>& argv,
const std::vector<std::string>& envp)
: Executor(exec_fd, absl::MakeSpan(argv), absl::MakeSpan(envp)) {}