google / libnop

libnop: C++ Native Object Protocols
Other
575 stars 59 forks source link

encode array of floats as binary container #17

Open corecode opened 4 years ago

corecode commented 4 years ago

Is there a reason why arrays of floating point numbers are not being encoded in a binary container?

eieio commented 4 years ago

No reason other than there isn't a specialization to handle it, like there is for integral types.

I think it makes sense to use the binary container encoding for floating point arrays.

corecode commented 4 years ago

It seems like e.g. the vector specialization just needs to be changed from EnableIfIntegral to EnableIfArithmetic?

eieio commented 4 years ago

That would work, but there might be users with data in the current encoding. It would be safer to add a separate specialization that can handle reading both encodings.

corecode commented 4 years ago

how would I implement this?

On 13/08/2020 20:19, Corey Tabaka wrote:

That would work, but there might be users with data in the current encoding. It would be safer to add a separate specialization that can handle reading both formats.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/google/libnop/issues/17#issuecomment-673635203, or unsubscribe https://github.com/notifications/unsubscribe-auth/AABLOO6A43W44QZV2C6R3K3SAQVCPANCNFSM4PVTX6EQ.

eieio commented 4 years ago

I'll look into it when I get a chance. I'm thinking of starting to maintain versioned releases to handle format breaking changes. Once I work that out I'll put up a point release with this change.