mirror of
https://github.com/bolero-MURAKAMI/Sprout
synced 2025-07-02 14:04:09 +00:00
add doc string operator+
This commit is contained in:
parent
5e83aa2c79
commit
b692583906
9 changed files with 391 additions and 30 deletions
62
source/libs/string/basic_string/operator-plus.rst
Normal file
62
source/libs/string/basic_string/operator-plus.rst
Normal file
|
@ -0,0 +1,62 @@
|
|||
.. _sprout-string-basic_string-operator-plus:
|
||||
###############################################################################
|
||||
operator+
|
||||
###############################################################################
|
||||
|
||||
Interface
|
||||
========================================
|
||||
.. sourcecode:: c++
|
||||
|
||||
template<typename T, std::size_t N, typename Traits>
|
||||
inline SPROUT_CONSTEXPR sprout::basic_string<T, N + 1, Traits>
|
||||
operator+(sprout::basic_string<T, N, Traits> const& lhs, T const& rhs);
|
||||
|
||||
template<typename T, std::size_t N, typename Traits>
|
||||
inline SPROUT_CONSTEXPR sprout::basic_string<T, 1 + N, Traits>
|
||||
operator+(T const& lhs, sprout::basic_string<T, N, Traits> const& rhs);
|
||||
|
||||
template<typename T, std::size_t N, typename Traits, std::size_t M>
|
||||
inline SPROUT_CONSTEXPR sprout::basic_string<T, N + (M - 1), Traits>
|
||||
operator+(sprout::basic_string<T, N, Traits> const& lhs, T const (& rhs)[M]);
|
||||
|
||||
template<typename T, std::size_t N, typename Traits, std::size_t M>
|
||||
inline SPROUT_CONSTEXPR sprout::basic_string<T, (M - 1) + N, Traits>
|
||||
operator+(T const (& lhs)[M], sprout::basic_string<T, N, Traits> const& rhs);
|
||||
|
||||
template<typename T, std::size_t N1, std::size_t N2, typename Traits>
|
||||
inline SPROUT_CONSTEXPR sprout::basic_string<T, N1 + N2, Traits>
|
||||
operator+(sprout::basic_string<T, N1, Traits> const& lhs, sprout::basic_string<T, N2, Traits> const& rhs);
|
||||
|
||||
Returns
|
||||
========================================
|
||||
|
||||
| A concatenated string.
|
||||
|
||||
Remarks
|
||||
========================================
|
||||
|
||||
| String buffer length of the result, become the largest number that can be stored of the concatenated argument.
|
||||
|
||||
Examples
|
||||
========================================
|
||||
.. sourcecode:: c++
|
||||
|
||||
#include <sprout/string.hpp>
|
||||
using namespace sprout;
|
||||
|
||||
SPROUT_STATIC_CONSTEXPR auto x = string<4>("mado");
|
||||
SPROUT_STATIC_CONSTEXPR auto y = string<4>("homu");
|
||||
SPROUT_STATIC_CONSTEXPR auto z = x + y;
|
||||
static_assert(z == "madohomu", "A concatenated string is madohomu.");
|
||||
|
||||
Complexity
|
||||
========================================
|
||||
|
||||
| Recursive function invocations in *O(1)* (constant) depth.
|
||||
|
||||
Header
|
||||
========================================
|
||||
|
||||
| ``sprout/string/concat.hpp``
|
||||
| Convenience header: ``sprout/string.hpp``
|
||||
|
|
@ -7,6 +7,7 @@ Sprout.String
|
|||
:hidden:
|
||||
|
||||
basic_string/swap-global
|
||||
basic_string/operator-plus
|
||||
basic_string/operator-equal_to
|
||||
basic_string/operator-not_equal_to
|
||||
basic_string/operator-less
|
||||
|
@ -89,7 +90,7 @@ function
|
|||
:doc:`operator\>\> <./basic_string/operator-right_shift>`
|
||||
============================================================ ===============================================================================
|
||||
|
||||
numeric conversions
|
||||
numeric conversions (string to numeric)
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
================================================================================ ===============================================================================
|
||||
|
@ -110,6 +111,14 @@ function
|
|||
:doc:`stod <./stod>`
|
||||
:doc:`stold <./stold>`
|
||||
:doc:`from_string \<FloatType\> <./from_string-floattype>`
|
||||
================================================================================ ===============================================================================
|
||||
|
||||
numeric conversions (numeric to string)
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
================================================================================ ===============================================================================
|
||||
function
|
||||
================================================================================ ===============================================================================
|
||||
:doc:`int_to_string <./int_to_string>`
|
||||
:doc:`to_string_of \<IntType\> <./to_string_of-inttype>`
|
||||
:doc:`to_string \<IntType\> <./to_string-inttype>`
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue