mirror of
https://github.com/FairRootGroup/FairMQ.git
synced 2025-10-15 17:41:45 +00:00
Fix various clang-tidy warnings
This commit is contained in:
committed by
Dennis Klein
parent
a65f0e6777
commit
499ffcd300
@@ -9,6 +9,8 @@
|
||||
#ifndef FAIR_MQ_TOOLS_STRINGS_H
|
||||
#define FAIR_MQ_TOOLS_STRINGS_H
|
||||
|
||||
#include <array>
|
||||
#include <boost/beast/core/span.hpp>
|
||||
#include <initializer_list>
|
||||
#include <sstream>
|
||||
#include <string>
|
||||
@@ -33,15 +35,16 @@ auto ToString(T&&... t) -> std::string
|
||||
}
|
||||
|
||||
/// @brief convert command line arguments from main function to vector of strings
|
||||
inline auto ToStrVector(const int argc, char* const argv[], const bool dropProgramName = true) -> std::vector<std::string>
|
||||
inline auto ToStrVector(const int argc, char*const* argv, const bool dropProgramName = true) -> std::vector<std::string>
|
||||
{
|
||||
auto res = std::vector<std::string>{};
|
||||
boost::beast::span<char*const> argvView(argv, argc);
|
||||
if (dropProgramName)
|
||||
{
|
||||
res.assign(argv + 1, argv + argc);
|
||||
res.assign(argvView.begin() + 1, argvView.end());
|
||||
} else
|
||||
{
|
||||
res.assign(argv, argv + argc);
|
||||
res.assign(argvView.begin(), argvView.end());
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
Reference in New Issue
Block a user