An issue with MakeUnique that I forgot to mention: you can't pass literal 
nullptr to MakeUnique.

This problem happens because gcc < 4.6 doesn't support true nullptr, and that 
interacts poorly with perfect forwarding.  See the long comment in mfbt/Move.h 
for details.  *Only* b2g-ics will break if you screw this up.  Tryservering 
other platforms won't point out this footgun.

The only workaround is to pass a null pointer value that has the actual type of 
the argument: static_cast<T*>(nullptr), say.

In short: if you break on a seemingly innocuous MakeUnique only on b2g-ics, 
it's probably this, and you should just fix the problem rather than back out 
the entire thing for this one weird mistake.

Dropping support for gcc < 4.6 cannot come soon enough.

Jeff
_______________________________________________
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform

Reply via email to