2 ms·
I haven't heard your personal informal definition of POD before. I've only concerned myself with the standard's definition of POD. If you were using a different
by mort96 2y ago
I haven't heard your personal informal definition of POD before. I've only concerned myself with the standard's definition of POD. If you were using a different definition of POD than the standard, you should have specified that. Or better yet, not used the term "POD", since it is widely understood to mean what the standard refers to as "POD".
EDIT: It seems I've had a slightly incorrect impression of "POD": what makes 'Person' non-POD isn't that it has an implicitly defined constructor but simply that it contains a non-POD type. The requirements for POD classes[1] includes "has no non-static data members of type non-POD class (or array of such types)". std::string is certainly a non-POD class, which makes discussion about Person's constructors and destructors moot. Not that it changes anything, but I don't wanna spread misinformation.
[1] https://en.cppreference.com/w/cpp/language/classes#POD_class https://en.cppreference.com/w/cpp/language/classes#POD_class