Table Of Contents

Previous topic

compare

Next topic

operator=

This Page

operator std::basic_string

Interface

template<typename Allocator>
SPROUT_EXPLICIT_CONVERSION SPROUT_NON_CONSTEXPR operator std::basic_string<T, Traits, Allocator>() const;

Returns

conversion to std::basic_string.

Examples

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

SPROUT_STATIC_CONSTEXPR auto x = string<8>("homuhomu");
auto y = static_cast<std::string>(x);
SPROUT_ASSERT_MASG(x == y.c_str(), "y is converted from x.");