Excuse my ignorance. Why does WindowSpec contain a construtor? Isn't it
a POD?
Repeating the answer I posted to the same question on the blog:
<quote>
Well, WindowSpec has a constructor just for convenience. By C++98/C++03
rules it’s therefore not a POD. By C++11 rules it is however a standard
layout class.
I am not sure of whether it is POD by the more relaxed C++11 rules. The
C++11 definition of POD is essentially that the class is both trivial
and standard-layout. But the definition of “trivial” is, as I see it,
open for interpretation, at least for pedantically formal folks.
Anyway, it’s just a convenience class, and since it relies on
assumptions about memory layout, it is very system-specific (but should
work with any Windows compiler). I started writing that code using a
std::vector<Byte> where I serialized the data, which would have have
yielded code that in principle could be more portable, but then I caught
myself: hey, introducing complexity to get system portable code for
Windows API? It was just reflex coding. So then I intentionally reworked
and simplified that as system-specific code.
</quote>
Cheers & hth.,
- Alf