utx::iota is a function object of class used to generate auto incremental values to a range.
Different with std::iota: utx::iota can take the range name as its parameter, without begin/end.
Different with std::ranges::iota: utx::iota accepts floating point and some more data types, not limited by std::iter_difference_t.
utx::iota: Range Algorithm
first_type last_itr = utx::iota(first, last, init);
first_type last_itr = utx::iota(range, init);
#include <utxcpp/numeric.hpp>
#include <utxcpp/numeric.hpp> #include <utxcpp/core.hpp> int main() { std::vector<utx::ix32> v1(11); utx::iota(v1, -5); utx::print(v1); // -5 -4 -3 -2 -1 0 1 2 3 4 5 std::vector<utx::fx32> v2(4); utx::iota(v2.begin(), v2.end(), 1.4f); utx::print(v2); // 1.400000 2.400000 3.400000 4.400000 }
c++ std::exception:
std::cout.write(err.data(), err.size());
std::cout << std::endl;
caught:
================================================== # The c++ programming language. # # # # Home: cppfx.xyz # # E # # Deck # ==================================================