c++ - How to use std::copy output with std::distance for a C-style array type -
how can store outputiterator returned std::copy
used parameter later std::distance
call?
i cannot use auto c++11 , need use c-style arrays.
that's kind of i'm trying do:
unsigned char data[max_data_len]; unsigned char x[max_x_len], y[max_y_len]; // cannot use auto here auto out = std::copy ( x, x + runtime_x_len , std::copy ( y, y + runtime_y_len , data ) ); size_t data_size = std::distance ( data , out );
for c-style arrays 'iterator' returned pointer element type.
so in case return value of std::copy()
unsigned char*
.
Comments
Post a Comment