You are currently browsing the FeradZ Blog blog archives for May, 2009

Uses of const in C++

To exmplain to a friend the different uses and semantics of "const" in c++ I come accross one very nicely written article "The C++ ‘const’ Declaration: Why & How". It concludes with an example that has all the possible uses of "const" in one statement. I copy & paste it here.

Of course one sometimes needs to combine some of these different uses of ‘const’ which can get confusing as in

const int*const Method3(const int*const&)const;

where the 5 uses ‘const’ respectively mean that the variable pointed to by the returned pointer & the returned pointer itself won’t be alterable and that the method does not alter the variable pointed to by the given pointer, the given pointer itself & the object of which it is a method!

Quality of Living by Countries for 2009

This morning I saw an article about ranking countries based on the quality of living (2009 Quality of Life Index). The ranking is prepared by International Living magazine. To produce the annual Index, the magazine takes into account nine categories: Cost of Living, Culture and Leisure, Economy, Environment, Freedom, Health, Infrastructure, Safety and Risk, and Climate. 

According to the index the first three countries are France, Switzerland and USA, and the last three countries are Somalia, Sudan and Yemen. Few countries such as Iraq and Afganistan are assigned 0 for safty and risk rating. Bulgaria is 42nd, Spain is 27th, Turkey 65th. The full list of the ranking can be found at 2009 Quality of Life Index.