From 552a5107778648cd64dec97b018d0663bee576da Mon Sep 17 00:00:00 2001 From: Wiktor Garbacz Date: Thu, 28 Jan 2021 08:42:35 -0800 Subject: [PATCH] Fix overload for Executor ctor calls with brace-initializers PiperOrigin-RevId: 354319778 Change-Id: I7b47ef2de734683f9168ef80f8b29357532d51ff --- sandboxed_api/sandbox2/executor.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/sandboxed_api/sandbox2/executor.h b/sandboxed_api/sandbox2/executor.h index 3031cb7..4010278 100644 --- a/sandboxed_api/sandbox2/executor.h +++ b/sandboxed_api/sandbox2/executor.h @@ -55,6 +55,9 @@ class Executor final { } // As above, but with `const std::vector&` + // Templated to avoid ambiguity with the absl::Span overloads when called + // with brace-initializers. + template Executor(absl::string_view path, const std::vector& argv, const std::vector& envp = CopyEnviron()) : Executor(path, absl::MakeSpan(argv), absl::MakeSpan(envp)) {} @@ -71,6 +74,9 @@ class Executor final { } // As above, but with `const std::vector&` + // Templated to avoid ambiguity with the absl::Span overloads when called + // with brace-initializers. + template Executor(int exec_fd, const std::vector& argv, const std::vector& envp) : Executor(exec_fd, absl::MakeSpan(argv), absl::MakeSpan(envp)) {}