This patch introduces the MOVABLE idiom indicating a class or struct supporting move semantics, analogous to the COPYABLE idiom, and uses it for the CGUI struct maps that store immutable XML data.
The design of the GUI is to load all data from the XML file and then only refer to that later on.
However during the course of its implementation, in a number of incidences this data was copied around for no reason, most crucially every frame in Draw or GenerateText calls.
For example rP22570 made CGUISpriteInstance NONCOPYABLE and MOVABLE following rP1518 introducing linker errors to avoid unintentonal copies in one specific function to CGUISpriteInstance after rP1507 unintentionally copied the entire CGUISpriteInstance DrawCall cache.
Another example is rP14493 removing the CGUISprite and SGUIImage copies by using pointers and making them NONCOPYABLE in advance.
This patch makes SGUIIcon and SGUIStyle NONCOPYABLE and MOVABLE as well and replace their copies by const references that were performed every CGUI::GenerateText and CGUIString::GenerateTextCall.
Use in-place move construction using emplace for the temporary objects created by the CGUI Xeromyces functions for these struct maps.
Finally as the cherry on top, make the struct values of these four CGUI "database" maps constant, because
(a) it is conceptually valid, because the data is considered permanent by the CGUI design since it only load and possibly replaces these structs from XML and maybe JS and only refers to that data later on (during draw calls).
(b) hence copies are unintentional copies and thus making the compiler complain protects against unintentional copies.
(c) unintentional copies are very easy to introduce, because the topic is complex (there are many rules to copy vs. move assignment, assignment vs constructor, guaranteed copy elision, permitted but not guaranteed optimizations, how containers perform), and commit history has shown that people do copy unintentionally.
The downside to making the map values const is that one has to erase if one wants to keep supporting overwriting of XML styles.
This is a bummer, but still seems much preferable to waste some nanoseconds when loading a page rather than wasting some nanoseconds every frame.
Making these const means that we gain assurance that the future of source/gui/ rendering will use no copies and that this is enforced by the compiler, whereas keeping it mutable means that we have to worry in every commit accessing these items.
Aside, erasing and inplace move constructing is still a performance improvement to the previous copy assignment on init.