зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1622344 - Ensure only trivially copyable structures use PlainOldDataSerializer. r=botond
Differential Revision: https://phabricator.services.mozilla.com/D66821 --HG-- extra : moz-landing-system : lando
This commit is contained in:
Родитель
fb868a6c13
Коммит
704b17d1c4
|
@ -252,8 +252,10 @@ struct BitFlagsEnumSerializer
|
|||
*/
|
||||
template <typename T>
|
||||
struct PlainOldDataSerializer {
|
||||
// TODO: Once the mozilla::IsPod trait is in good enough shape (bug 900042),
|
||||
// static_assert that mozilla::IsPod<T>::value is true.
|
||||
static_assert(
|
||||
std::is_trivially_copyable<T>::value,
|
||||
"PlainOldDataSerializer can only be used with trivially copyable types!");
|
||||
|
||||
typedef T paramType;
|
||||
|
||||
static void Write(Message* aMsg, const paramType& aParam) {
|
||||
|
|
Загрузка…
Ссылка в новой задаче