Skip to content

Commit 7b34593

Browse files
committed
Remove Swift's copy of llvm::interleave
This is only needed on the master branch, which doesn't have LLVM's copy, yet.
1 parent 36279e2 commit 7b34593

File tree

1 file changed

+0
-43
lines changed

1 file changed

+0
-43
lines changed

include/swift/Basic/STLExtras.h

Lines changed: 0 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -69,49 +69,6 @@ struct function_traits<R (T::*)(Args...) const> {
6969
using argument_types = std::tuple<Args...>;
7070
};
7171

72-
} // end namespace swift
73-
74-
namespace llvm {
75-
76-
/// @{
77-
78-
/// An STL-style algorithm similar to std::for_each that applies a second
79-
/// functor between every pair of elements.
80-
///
81-
/// This provides the control flow logic to, for example, print a
82-
/// comma-separated list:
83-
/// \code
84-
/// interleave(names.begin(), names.end(),
85-
/// [&](StringRef name) { OS << name; },
86-
/// [&] { OS << ", "; });
87-
/// \endcode
88-
template <typename ForwardIterator, typename UnaryFunctor,
89-
typename NullaryFunctor>
90-
inline void interleave(ForwardIterator begin, ForwardIterator end,
91-
UnaryFunctor each_fn,
92-
NullaryFunctor between_fn) {
93-
if (begin == end)
94-
return;
95-
each_fn(*begin);
96-
++begin;
97-
for (; begin != end; ++begin) {
98-
between_fn();
99-
each_fn(*begin);
100-
}
101-
}
102-
103-
template <typename Container, typename UnaryFunctor, typename NullaryFunctor>
104-
inline void interleave(const Container &c, UnaryFunctor each_fn,
105-
NullaryFunctor between_fn) {
106-
interleave(c.begin(), c.end(), each_fn, between_fn);
107-
}
108-
109-
/// @}
110-
111-
} // end namespace llvm
112-
113-
namespace swift {
114-
11572
/// @{
11673

11774
/// The equivalent of std::for_each, but for two lists at once.

0 commit comments

Comments
 (0)