1
1
Fork 0
mirror of https://github.com/NixOS/nix.git synced 2025-11-16 15:32:43 +01:00

Add fresh concatStringsSep without bug

The buggy version was previously renamed to
dropEmptyInitThenConcatStringsSep
This commit is contained in:
Robert Hensing 2024-07-12 23:02:08 +02:00
parent 79eb0adf9d
commit a681d354e7
5 changed files with 150 additions and 0 deletions

21
src/libutil/strings.hh Normal file
View file

@ -0,0 +1,21 @@
#pragma once
#include <list>
#include <set>
#include <string_view>
#include <string>
#include <vector>
namespace nix {
/**
* Concatenate the given strings with a separator between the elements.
*/
template<class C>
std::string concatStringsSep(const std::string_view sep, const C & ss);
extern template std::string concatStringsSep(std::string_view, const std::list<std::string> &);
extern template std::string concatStringsSep(std::string_view, const std::set<std::string> &);
extern template std::string concatStringsSep(std::string_view, const std::vector<std::string> &);
}