You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
std::is_pod works in C++11 as the definition was relaxed.
The problem is that boost::is_pod is based on C++03 definition of POD.
Formal definition from the C++ standard (C++03 8.5.1 §1):
An aggregate is an array or a class (clause 9) with no user-declared constructors (12.1), no private or protected non-static data members (clause 11), no base classes (clause 10), and no virtual functions (10.3).
Formal definition from the C++ standard (C++03 9 §4):
A POD-struct is an aggregate class that has no non-static data members of type non-POD-struct, non-POD-union (or array of such types) or reference, and has no user-defined copy assignment operator and no user-defined destructor. Similarly, a POD-union is an aggregate union that has no non-static data members of type non-POD-struct, non-POD-union (or array of such types) or reference, and has no user-defined copy assignment operator and no user-defined destructor. A POD class is a class that is either a POD-struct or a POD-union.
The text was updated successfully, but these errors were encountered:
It's true that endian_buffer is not a C++03 POD, but there's a test that it can be used in a union, and this test passes. So I'm not sure that making the data member public is really necessary in practice.
Even when we define
endian_buffer is not a POD, because it uses a protected data member.
See https://wandbox.org/permlink/PSYwP0oCoJ9cNtkV
Defining it as public in C++03 solves the issue.
std::is_pod works in C++11 as the definition was relaxed.
The problem is that boost::is_pod is based on C++03 definition of POD.
Formal definition from the C++ standard (C++03 8.5.1 §1):
Formal definition from the C++ standard (C++03 9 §4):
The text was updated successfully, but these errors were encountered: