Closed mipac closed 3 years ago
Hi,
It's expected behavior because univector
created using make_univector
only reads/writes data referenced and doesn't modify the container itself (std::vector in your case) because after creation it doesn't even know the original type.
It's intended mainly for avoiding redundant data copy and using kfr expressions directly on your data without creating temporary univector
.
Example:
void process_gain(float* data, size_t size, float gain)
{
auto buf = make_univector(data, size); // no data copy
buf *= gain; // operates directly on data
}
So when using any container except univector
you're responsible for setting the correct size before processing.
using pure univector and ref univector don't present the same behaviour
uout, and so out, are empty, not resized but if I use
out.size() == in.size() is ok is it a bug, or a correct behaviour?