Em sexta-feira, 3 de março de 2017, às 03:19:42 PST, Marc Mutz escreveu:
> The simplest implementation of an immutable class that cannot or should not
> contain all state inline (like QRect) is an int +
> Q_GLOBAL_STATIC(Container). If you put all init code into the ctor of the
> Container class, then you get thread-saftey for free, too. Only if you want
> to add entries dynamically you need to think about threading. And all the
> special member functions come for free, too, fully optimal (nothrow,
> inline).

Sorry, no.

If you need to have a global static to store information, then it sounds 
wrong. I agree we should use ints, enums and opaque pointers when wrapping a 
third-party API that is like that. If they have a global table, that's their 
business.

But we should not add more global tables.

-- 
Thiago Macieira - thiago.macieira (AT) intel.com
  Software Architect - Intel Open Source Technology Center

_______________________________________________
Development mailing list
[email protected]
http://lists.qt-project.org/mailman/listinfo/development

Reply via email to