Table Of Contents

Previous topic

resize

Next topic

empty

This Page

clear

Interface

void clear() SPROUT_NOEXCEPT;

Effects

Fill [begin,end) with value_type(), and set the 0 to length.

Examples

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

auto x = string<8>("homuhomu");
int main() {
  x.clear();
  SPROUT_ASSERT_MSG(x.size() == 0 && x == "", "string is cleared.");
}