.. _sprout-array-array-operator-assign: ############################################################################### operator= ############################################################################### Interface ======================================== .. sourcecode:: c++ template SPROUT_CXX14_CONSTEXPR array& operator=(array const& rhs); template SPROUT_CXX14_CONSTEXPR array& operator=(array&& rhs); Effects ======================================== | ``std::copy(rhs.begin(), rhs.end(), begin())``. | or | ``std::move(rhs.begin(), rhs.end(), begin())``. Returns ======================================== | ``*this``. Examples ======================================== .. sourcecode:: c++ #include #include using namespace sprout; auto x = array{{1, 2, 3, 4, 5, 6, 7, 8, 9, 10}}; SPROUT_STATIC_CONSTEXPR auto y = array{{10, 9, 8, 7, 6, 5, 4, 3, 2, 1}}; int main() { x = y; SPROUT_ASSERT_MSG(x == y, "y is assigned to x."); } Header ======================================== | ``sprout/array/array.hpp`` | Convenience header: ``sprout/array.hpp``