An iterator is passed to the function and the number of bytes that must be copied to the dynamic array, which is accessible via unique_ptr. How do I properly call std :: copy and std :: memcpy in this case?
void Foo(std::iterator<std::input_iterator_tag, uint8_t> iter, int32_t length) { unique_ptr<char[]> container = make_unique<char[]>(100); std::copy (iter, iter + length, container); // ΠΠ°ΠΊ ΡΠΊΠΎΠΏΠΈΡΠΎΠ²Π°ΡΡ ΡΠΎΠ΄Π΅ΡΠΆΠΈΠΌΠΎΠ΅ iter Π² container std::memcpy (container, iter , length); // ΠΠ°ΠΊ ΡΠΊΠΎΠΏΠΈΡΠΎΠ²Π°ΡΡ ΡΠΎΠ΄Π΅ΡΠΆΠΈΠΌΠΎΠ΅ iter Π² container for (int i = 0; i < length; i++) cout << container[i]; };
std::iteratortemplate has nothing to do with how you try to use it in this code. - AnT