mirror of
https://github.com/bolero-MURAKAMI/Sprout.git
synced 2025-07-16 15:14:13 +00:00
add doc: char_traits string operations (for iterator)
This commit is contained in:
parent
0ef068c92b
commit
dd0c5f4dbb
47 changed files with 1722 additions and 60 deletions
40
source/libs/string/char_traits/assign-iterator.rst
Normal file
40
source/libs/string/char_traits/assign-iterator.rst
Normal file
|
@ -0,0 +1,40 @@
|
|||
.. _sprout-string-char_traits-assign-iterator:
|
||||
###############################################################################
|
||||
assign
|
||||
###############################################################################
|
||||
|
||||
Interface
|
||||
========================================
|
||||
.. sourcecode:: c++
|
||||
|
||||
template<typename OutputIterator>
|
||||
static OutputIterator assign(OutputIterator s, std::size_t n, char_type a);
|
||||
|
||||
Effects
|
||||
========================================
|
||||
|
||||
| For each i in [0,n) performs ``assign(s[i], c)``.
|
||||
|
||||
Examples
|
||||
========================================
|
||||
.. sourcecode:: c++
|
||||
|
||||
#include <sprout/string.hpp>
|
||||
#include <sprout/assert.hpp>
|
||||
using namespace sprout;
|
||||
|
||||
auto x = string<8>("homuhomu");;
|
||||
char_traits<char>::assign(x.begin(), 8, 'M');
|
||||
SPROUT_ASSERT_MSG(x[0] == 'M', "x is filled by M.");
|
||||
|
||||
Complexity
|
||||
========================================
|
||||
|
||||
| linear.
|
||||
|
||||
Header
|
||||
========================================
|
||||
|
||||
| ``sprout/string/char_traits.hpp``
|
||||
| Convenience header: ``sprout/string.hpp``
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue