2013-09-05 05:09:23 +00:00
|
|
|
.. _sprout-string-char_traits-move:
|
|
|
|
###############################################################################
|
|
|
|
move
|
|
|
|
###############################################################################
|
|
|
|
|
|
|
|
Interface
|
|
|
|
========================================
|
|
|
|
.. sourcecode:: c++
|
|
|
|
|
2013-11-04 05:31:03 +00:00
|
|
|
static SPROUT_CXX14_CONSTEXPR char_type* move(char_type* s1, char_type const* s2, std::size_t n);
|
2013-09-05 05:09:23 +00:00
|
|
|
|
|
|
|
Effects
|
|
|
|
========================================
|
|
|
|
|
|
|
|
| Equivalent to ``std::char_traits<Char>::move(s1, s2, n)``.
|
|
|
|
|
|
|
|
Examples
|
|
|
|
========================================
|
|
|
|
.. sourcecode:: c++
|
|
|
|
|
|
|
|
#include <sprout/string.hpp>
|
|
|
|
#include <sprout/assert.hpp>
|
|
|
|
using namespace sprout;
|
|
|
|
|
|
|
|
char x[] = "homuhomu";
|
|
|
|
SPROUT_STATIC_CONSTEXPR char const* y = "madocchi";
|
2013-09-13 08:22:10 +00:00
|
|
|
int main() {
|
|
|
|
char_traits<char>::move(x, y, 8);
|
|
|
|
SPROUT_ASSERT_MSG(x[0] == y[0], "y is copied to x.");
|
|
|
|
}
|
2013-09-05 05:09:23 +00:00
|
|
|
|
|
|
|
Complexity
|
|
|
|
========================================
|
|
|
|
|
|
|
|
| linear.
|
|
|
|
|
|
|
|
Header
|
|
|
|
========================================
|
|
|
|
|
|
|
|
| ``sprout/string/char_traits.hpp``
|
|
|
|
| Convenience header: ``sprout/string.hpp``
|
|
|
|
|