]> git.ipfire.org Git - thirdparty/ccache.git/commitdiff
enhance: Add Args::push_back(std::string&& arg)
authorJoel Rosdahl <joel@rosdahl.net>
Sun, 14 Jan 2024 09:35:25 +0000 (10:35 +0100)
committerJoel Rosdahl <joel@rosdahl.net>
Sun, 14 Jan 2024 09:35:25 +0000 (10:35 +0100)
src/Args.cpp
src/Args.hpp

index 4349654a3b1e275c3ef9b7ac918b2f5f9d4eefca..44a09ddbf4c701b1bf5f15c1d28ec2f93d97640c 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2020-2023 Joel Rosdahl and other contributors
+// Copyright (C) 2020-2024 Joel Rosdahl and other contributors
 //
 // See doc/AUTHORS.adoc for a complete list of contributors.
 //
@@ -238,12 +238,6 @@ Args::pop_front(size_t count)
   m_args.erase(m_args.begin(), m_args.begin() + count);
 }
 
-void
-Args::push_back(const std::string& arg)
-{
-  m_args.push_back(arg);
-}
-
 void
 Args::push_back(const Args& args)
 {
index 825e95be4bdc69ccb5c051f3460d9db44d24a2f5..0370d09f5603c6dfb3d8fb2ac9d82c083733acd4 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2020-2022 Joel Rosdahl and other contributors
+// Copyright (C) 2020-2024 Joel Rosdahl and other contributors
 //
 // See doc/AUTHORS.adoc for a complete list of contributors.
 //
@@ -82,6 +82,7 @@ public:
 
   // Add `arg` to the end.
   void push_back(const std::string& arg);
+  void push_back(std::string&& arg);
 
   // Add `args` to the end.
   void push_back(const Args& args);
@@ -131,3 +132,15 @@ Args::operator[](size_t i)
 {
   return m_args[i];
 }
+
+inline void
+Args::push_back(const std::string& arg)
+{
+  m_args.push_back(arg);
+}
+
+inline void
+Args::push_back(std::string&& arg)
+{
+  m_args.push_back(arg);
+}