1 #ifndef LIBJMMCG_CORE_BASIC_STACK_STRING_HPP
2 #define LIBJMMCG_CORE_BASIC_STACK_STRING_HPP
27 #include "boost/mpl/assert.hpp"
51 class traits=
std::char_traits<charT>
57 using native_databus_type=
unsigned long;
72 static_assert(
std::is_pod<
value_type>::value,
"The contained type must be a POD due to the implementation.");
78 ((BuffN+
sizeof(native_databus_type))/
sizeof(native_databus_type))*
sizeof(native_databus_type)
81 BOOST_MPL_ASSERT_RELATION(
sizeof(pointer), <=, small_string_max_size);
99 typedef value_type __attribute__ ((aligned (
sizeof(native_databus_type))))
const * ensure_char_ptr_argument_aligned;
214 return std::numeric_limits<
typename iterator_traits::difference_type>::max();
394 num_fast_copy_values=
sizeof(fast_copy_values)/
sizeof(native_databus_type)
396 BOOST_MPL_ASSERT_RELATION(
sizeof(pointer), <=,
sizeof(fast_copy_values));
397 BOOST_MPL_ASSERT_RELATION(
sizeof(small_basic_stack_string), <=,
sizeof(fast_copy_values));
398 BOOST_MPL_ASSERT_RELATION(
sizeof(small_basic_stack_string), ==, small_string_max_size);
399 BOOST_MPL_ASSERT_RELATION(small_string_max_size, <=, num_fast_copy_values*
sizeof(native_databus_type));
404 template<
std::size_t SrcSz>
413 constexpr void copy(native_databus_type
const *src)
noexcept(
true)
FORCE_INLINE;
419 constexpr void copy(ensure_char_ptr_argument_aligned src)
noexcept(
true)
FORCE_INLINE;
421 copy(
value_type const (& src)[SrcSz])
noexcept(
true);
424 void swap(buffer_type &buff)
noexcept(
true)
FORCE_INLINE;
425 void move(
size_type cap,
typename iterator_traits::difference_type f,
typename iterator_traits::difference_type l,
size_type n)
noexcept(
true)
FORCE_INLINE;
440 template<
unsigned int BuffN,
class charT,
class traits>
std::basic_ostream<charT, traits> &
441 operator<<(
std::basic_ostream<charT, traits> &os, basic_stack_string<BuffN, charT, traits>
const &s)
noexcept(
false);
443 template<
unsigned int BuffN,
class charT,
class traits>
std::basic_istream<charT, traits> &
444 operator>>(
std::basic_istream<charT, traits> &os, basic_stack_string<BuffN, charT, traits> &s)
noexcept(
false);