llvm::replace

replace overloads

Synopses

Declared in <llvm/ADT/STLExtras.h>

Replace occurrences of OldValue with NewValue in Range.

template<
    typename R,
    typename T>
void
replace(
    R&& Range,
    T const& OldValue,
    T const& NewValue);
» more...

Replace []ContIt, ContEnd) in Cont with the elements of R.

template<
    typename Container,
    typename Range = std::initializer_list<Container::value_type>>
void
replace(
    Container& Cont,
    Container::iterator ContIt,
    Container::iterator ContEnd,
    Range&& R);
» more...

Replace []ContIt, ContEnd) in Cont with []ValIt, ValEnd).

template<
    typename Container,
    typename RandomAccessIterator>
void
replace(
    Container& Cont,
    Container::iterator ContIt,
    Container::iterator ContEnd,
    RandomAccessIterator ValIt,
    RandomAccessIterator ValEnd);
» more...

Parameters

NameDescription
RangeRange whose elements are updated.
OldValueValue to replace.
NewValueReplacement value.
ContSequence container to modify.
ContItStart of the destination subrange.
ContEndEnd of the destination subrange.
RReplacement range.
ValItStart of the replacement values.
ValEndEnd of the replacement values.