Posted inInformation Technology

C++ 11 and Qt — Part 4 Test Your Compiler

As promised, here is a test to see if your compiler actually handles initialization lists correctly or adopted a “last one in wins” strategy. #ifndef SMALLDATA_H #define SMALLDATA_H class SmallData { public:     explicit SmallData( int nuVal);     explicit SmallData();     ~SmallData();      private:     int m_data = 8; }; #endif // SMALLDATA_H   #include “SmallData.h” #include <iostream> SmallData::SmallData() {     std::cout << “SmallData Default constructor data value ” << m_data << std::endl; } … C++ 11 and Qt — Part 4 Test Your CompilerRead more