Table Of Contents

Previous topic

copy

Next topic

swap

This Page

assign

Interface

template<typename OutputIterator>
static OutputIterator assign(OutputIterator s, std::size_t n, char_type a);

Effects

For each i in [0,n) performs assign(s[i], c).

Examples

#include <sprout/string.hpp>
#include <sprout/assert.hpp>
using namespace sprout;

auto x = string<8>("homuhomu");;
char_traits<char>::assign(x.begin(), 8, 'M');
SPROUT_ASSERT_MSG(x[0] == 'M', "x is filled by M.");

Complexity

linear.