How to automatically convert strongly typed enum into int?

Strongly typed enums aiming to solve multiple problems and not only scoping problem as you mentioned in your question: Provide type safety, thus eliminating implicit conversion to integer by integral promotion. Specify underlying types. Provide strong scoping. Thus, it is impossible to implicitly convert a strongly typed enum to integers, or even its underlying type … Read more

How well is Unicode supported in C++11?

How well does the C++ standard library support unicode? Terribly. A quick scan through the library facilities that might provide Unicode support gives me this list: Strings library Localization library Input/output library Regular expressions library I think all but the first one provide terrible support. I’ll get back to it in more detail after a … Read more

Iterator Loop vs index loop

The special thing about iterators is that they provide the glue between algorithms and containers. For generic code, the recommendation would be to use a combination of STL algorithms (e.g. find, sort, remove, copy) etc. that carries out the computation that you have in mind on your data structure (vector, list, map etc.), and to supply that algorithm with iterators into your container. … Read more

Does C++11 have C#-style properties?

In C#, there is a nice syntax sugar for fields with getter and setter. Moreover, I like the auto-implemented properties which allow me to write In C++ I have to write Is there some such concept in the C++11 allowing me to have some syntax sugar on this?

Use the auto keyword in C++ STL

The auto keyword is simply asking the compiler to deduce the type of the variable from the initialization. Even a pre-C++0x compiler knows what the type of an (initialization) expression is, and more often than not, you can see that type in error messages. The auto keyword simply allows you to take advantage of this … Read more