tahonermann / text_view

A C++ concepts and range based character encoding and code point enumeration library
MIT License
122 stars 14 forks source link

Optimize text view and text iterator size by declaring the encoding state as a data member rather than deriving from it when doing so is beneficial #8

Open tahonermann opened 8 years ago

tahonermann commented 8 years ago

Modify text_view and text iterators to derive from the encoding state type only if the state type is an empty class and to declare a non-static data member otherwise. This will reduce the size of text_view and text iterator objects when the encoding state type is non-empty and has lower alignment requirements than the first non-static data member of the text_view and text iterator types.