I would encourage new code to use standard type traits like `std::is_trivial` and `std::is_standard_layout`. Unfortuantely, for the IPC use case in particular, I'm not sure what would be a useful trait: * `mozilla::Maybe` passes `std::is_standard_layout`, thus making it ineffective for the sorts of cases we want to catch * any type with a user-defined constructor or even a default member initializer fails `std::is_trivial` (and `std::is_pod`), and pretty much all of our IPC structs have one or the other to make sure all their fields are initializer
Bug 900042 Comment 14 Edit History
Note: The actual edited comment in the bug view page will always show the original commenter’s name and original timestamp.
I would encourage new code to use standard type traits like `std::is_trivial` and `std::is_standard_layout`. Unfortuantely, for the IPC use case in particular, I'm not sure what would be a useful trait: * `mozilla::Maybe` passes `std::is_standard_layout`, thus making it ineffective for the sorts of cases we want to catch * any type with a user-defined constructor or even a default member initializer fails `std::is_trivial` (and `std::is_pod`), and pretty much all of our IPC structs have one or the other to make sure all their fields are initialized