template<std::size_t N2>
SPROUT_CONSTEXPR int compare(basic_string<T, N2, Traits> const& str) const;
#include <sprout/string.hpp>
using namespace sprout;
SPROUT_STATIC_CONSTEXPR auto x = string<8>("homuhomu");
SPROUT_STATIC_CONSTEXPR auto y = string<8>("madocchi");
SPROUT_STATIC_CONSTEXPR auto result = x.compare(y);
static_assert(result < 0, "x is less than y.");
Note
The current implementation is incomplete. O(N) (linear) depth.
template<std::size_t N2>
SPROUT_CONSTEXPR int compare(size_type pos1, size_type n1, basic_string<T, N2, Traits> const& str) const;
template<std::size_t N2>
SPROUT_CONSTEXPR int compare(size_type pos1, size_type n1, basic_string<T, N2, Traits> const& str, size_type pos2, size_type n2) const;
SPROUT_CONSTEXPR int compare(value_type const* s) const;
SPROUT_CONSTEXPR int compare(size_type pos1, size_type n1, value_type const* s) const;
SPROUT_CONSTEXPR int compare(size_type pos1, size_type n1, value_type const* s, size_type n2) const;