diff options
| author | Curtis J Bezault <curtbezault@gmail.com> | 2019-04-11 08:27:44 -0700 |
|---|---|---|
| committer | Phil Christensen <philc@microsoft.com> | 2019-04-11 08:27:44 -0700 |
| commit | 8fe6f4bdd83f0b912327693c22e132c0c8f82744 (patch) | |
| tree | dbd3ad2f1d55b870f479ded3ff8505da266ae9c5 /toolsrc/include | |
| parent | f58e82f45ce0b0c933bf2814e2114997e00af8af (diff) | |
| download | vcpkg-8fe6f4bdd83f0b912327693c22e132c0c8f82744.tar.gz vcpkg-8fe6f4bdd83f0b912327693c22e132c0c8f82744.zip | |
Print what port installed confliciting files (#6037)
Diffstat (limited to 'toolsrc/include')
| -rw-r--r-- | toolsrc/include/vcpkg/base/strings.h | 26 |
1 files changed, 21 insertions, 5 deletions
diff --git a/toolsrc/include/vcpkg/base/strings.h b/toolsrc/include/vcpkg/base/strings.h index 16876cf5c..3165dc8ee 100644 --- a/toolsrc/include/vcpkg/base/strings.h +++ b/toolsrc/include/vcpkg/base/strings.h @@ -112,12 +112,10 @@ namespace vcpkg::Strings bool ends_with(StringView s, StringView pattern); bool starts_with(StringView s, StringView pattern); - template<class Container, class Transformer> - std::string join(const char* delimiter, const Container& v, Transformer transformer) + template<class InputIterator, class Transformer> + std::string join(const char* delimiter, InputIterator begin, InputIterator end, + Transformer transformer) { - const auto begin = v.begin(); - const auto end = v.end(); - if (begin == end) { return std::string(); @@ -133,6 +131,24 @@ namespace vcpkg::Strings return output; } + + template<class Container, class Transformer> + std::string join(const char* delimiter, const Container& v, Transformer transformer) + { + const auto begin = v.begin(); + const auto end = v.end(); + + return join(delimiter, begin, end, transformer); + } + + template<class InputIterator> + std::string join(const char* delimiter, InputIterator begin, InputIterator end) + { + using Element = decltype(*begin); + return join(delimiter, begin, end, + [](const Element& x) -> const Element& { return x; }); + } + template<class Container> std::string join(const char* delimiter, const Container& v) { |
