|
|
|
|
| 1) Why does the program work without the utility header being included for the move function? |
| 2) Why does parenthesis have to be used to initialize firstname and secondname instead of braces? |
|
|
error C2797: 'Person::firstname': list initialization inside member initializer list or non-static data member initializer is not implemented |
std::greater<>.#include <initializer_list> http://www.cplusplus.com/reference/initializer_list/initializer_list/ http://en.cppreference.com/w/cpp/utility/initializer_list |
<iostream> say, so that I could use std::size_t - I haven't had to do that with other IDE / compilers. It's weird because I may not have needed iostream for anything in my header file.
firstname(std::move(first)), secondname(std::move(second)). The complier error message says that list initialization inside member initializer list is not implemented. So, what does this mean? What is the member initializer list? |
|
string (string&& str) noexcept but no move function. How it works without the utility preprocess directive is beyond me.
| The complier error message says that list initialization inside member initializer list is not implemented. So, what does this mean? |
| What is the member initializer list? |
| I find it mind boggling that I am not able to use braces |
| [1] NSDMIs and initializer lists were previously listed as Yes, but have been downgraded to Partial. After users encountered silent bad codegen when using braced-init-lists in NSDMIs and mem-initializer-lists, the compiler team blocked these broken scenarios with a compiler error C2797. This VCBlog post published in August has more info, and this is planned to be completely fixed in 2015 RTM. |
| The entities in the C ++ standard library are defined in headers, whose contents are made available to a translation unit when it contains the appropriate #include preprocessing directive. .... A translation unit shall ... include the header lexically before the first reference in that translation unit to any of the entities declared in that header. - IS |