[cpp,c++] Use STL algorithm on std::span
Use std::iota
Use std::copy
Use utxcpp
Use utx::print_all
Use std::span
Use std::vector
Use std::array
#include <utxcpp/core.hpp> #include <numeric> #include <span> #include <vector> #include <array> int main() { std::vector<utx::i32> vector(1000); std::span<utx::i32> span{vector}; std::iota(span.begin(), span.end(), 0); std::span<utx::i32> span2{vector.begin()+10, 15}; std::array<utx::i32, 15> array; std::span<utx::i32> span3{array}; std::copy(span2.begin(), span2.end(), span3.begin()); utx::print_all(array, span3); /* 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 */ }
Comments
Display comments as Linear | Threaded