Opened 10 years ago
Closed 9 years ago
#7158 closed Patches (fixed)
Add serialization support for std::array
Reported by: | Owned by: | Robert Ramey | |
---|---|---|---|
Milestone: | Boost 1.51.0 | Component: | serialization |
Version: | Boost 1.51.0 | Severity: | Problem |
Keywords: | Cc: |
Description
Add support for std::array to boost/serialization/array.hpp where it is available.
Attachments (1)
Change History (3)
by , 10 years ago
Attachment: | serialize-std-array.patch added |
---|
comment:1 by , 10 years ago
Interesting - this is new to me.
At first I couldn't see the following are different. After looking at the standard I do see a difference.
int x[10]; array<in, 10> x;
I like your implementation - makes sense. But I'm concerned about the possibility of undetected subtlties - like sizeof(x) returning bytes whild x.size() returns elements. Inside the serialzation of an array we use sizeof(x)/sizeof(int) to figure the number of elements. Since <array> supports arrays of zero elements - but I suspect that the sizeof(std::array<int, 0>) is not zero, it's not clear that your implementation isn't bulletproof.
At the very minimum this would need a test to detect implementation quirks in <array>.
Take another look at this.
Robert Ramey
PS. I see now that <array> isn't a replacement for x[] but rather for boost::array. I don't know if we're even testing boost/array.hpp for serialization. RR
comment:2 by , 9 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
I've implemented serialization for <array> and checked it into the development branch. It's included in the header boost/serializaiton/array.hpp
Robert Ramey
Add support for std::array to serialization/array.hpp