zpp_bits icon indicating copy to clipboard operation
zpp_bits copied to clipboard

std::valarray is not serializable

Open SobhanMP opened this issue 1 year ago • 2 comments

Hi, https://godbolt.org/z/xrbv7x415

There are at least two issues, valarrays use std::begin instead of .begin and they don't have std::iterator.

std::begin return T* as far as I understand.

What would be the right place to add support for valarrays?

SobhanMP avatar May 05 '24 22:05 SobhanMP

Interesting case, since std::valarray is not directly part of the containers library in the standard the concepts don't apply to it. I will take a look, but this should be a temporary workaround, to wrap it with a span, although when loading a valarray you need to know the size and do the resize yourself: https://godbolt.org/z/hjKKnocE9

If you want a complete solution, for the time being use an external serialize function until I add support for this similar to issue https://github.com/eyalz800/zpp_bits/issues/160

eyalz800 avatar May 07 '24 07:05 eyalz800

thanks!

SobhanMP avatar May 08 '24 08:05 SobhanMP