mirror of
https://github.com/bolero-MURAKAMI/Sprout
synced 2025-07-02 14:04:09 +00:00
41 lines
1,001 B
ReStructuredText
41 lines
1,001 B
ReStructuredText
.. _sprout-array-array-operator-assign:
|
|
###############################################################################
|
|
operator=
|
|
###############################################################################
|
|
|
|
Interface
|
|
========================================
|
|
.. sourcecode:: c++
|
|
|
|
template<typename T2>
|
|
array& operator=(array<T2, N> const& rhs);
|
|
|
|
template<typename T2>
|
|
array& operator=(array<T2, N>&& rhs);
|
|
|
|
Effects
|
|
========================================
|
|
|
|
| ``std::copy(rhs.begin(), rhs.end(), begin())``, ``std::move(rhs.begin(), rhs.end(), begin())``.
|
|
|
|
Returns
|
|
========================================
|
|
|
|
| ``*this``.
|
|
|
|
Examples
|
|
========================================
|
|
.. sourcecode:: c++
|
|
|
|
#include <sprout/array.hpp>
|
|
using namespace sprout;
|
|
|
|
auto x = array<int, 10>{{1, 2, 3, 4, 5, 6, 7, 8, 9, 10}};
|
|
x = array<int, 10>{{10, 9, 8, 7, 6, 5, 4, 3, 2, 1}};
|
|
|
|
Header
|
|
========================================
|
|
|
|
| ``sprout/array/array.hpp``
|
|
| Convenience header: ``sprout/array.hpp``
|
|
|