Open RogerioY opened 5 years ago
An example of such a change is:
// indexing char operator[](int index) const; char operator()(int index) const; char& operator[](int index); char& operator()(int index);
goes to..
// indexing char operator[](int index) const; char operator()(int index) const; char& operator[](int index) = delete; char& operator()(int index) = delete;
Where the return-by-reference methods perform memory allocations etc on the internal representations of the text data.
I am certain we make many unnecessary allocations per frame and I am compounding this issue by making more use of this class.
I've made the decision to solve the string related build warnings by making use of the same handwound Text class used by GUI code. I think there some potentially wasteful methods on the Text class which we can restrict without losing a lot of flexibility.