by yuushi · 8y ago · 0 comments
U do_something(const std::vector<T>& vec); U do_something(std::vector<T> const *vec) {
T item = (*vec)[1];
...;
}
We can get away with this because the type `std::vector<T>` is known at compile time. It goes back to C and passing pointers of structs all over the place.The const on the right side makes sure the compiler keeps the memory at the pointed location safe like the const used in your initial question.
output_type do_something(buffer_view input);