.. _sprout-string-basic_string-operator-plus: ############################################################################### operator+ ############################################################################### Interface ======================================== .. sourcecode:: c++ template inline SPROUT_CONSTEXPR sprout::basic_string operator+(sprout::basic_string const& lhs, T const& rhs); template inline SPROUT_CONSTEXPR sprout::basic_string operator+(T const& lhs, sprout::basic_string const& rhs); template inline SPROUT_CONSTEXPR sprout::basic_string operator+(sprout::basic_string const& lhs, T const (& rhs)[M]); template inline SPROUT_CONSTEXPR sprout::basic_string operator+(T const (& lhs)[M], sprout::basic_string const& rhs); template inline SPROUT_CONSTEXPR sprout::basic_string operator+(sprout::basic_string const& lhs, sprout::basic_string 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 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``