error C2440: 'initializing' : cannot convert from 'initializer-list' to 'Vector<int>'
1> No constructor could take the source type, or constructor overload resolution was ambiguous
Sorry Helios, but the code without the assignment operator does not work either. The book that I am reading supports andywestken's comment that the initialization can be performed with or without the assignment operator.
I downloaded Microsoft Visual Studio 2013 Update 4 from the link supplied. I restarted my computer, ran the program with direct initialization, and the same error occurs.
I then removed from the program the header file used by the book and used the header files that you used. The program works by direct initialization and by copy initialization. Thank you very much.
My complier version is
compiler version: 1800 build: 31101
Press any key to continue . . .
compiler version: 1800 build: 31101 is the compiler which comes with Visual Studio 2013 Update 4.
Just compiled the code on a Windows machine with Visual Studio 2013 Update 4
(compiler version: 1800 build: 31101). (It compiled cleanly).
> error C2440: 'initializing' : cannot convert from 'initializer-list' to 'Vector<int>'
Check the case; it is vector (with a lower case 'v').
Tip: Get rid of the habit of using namespace std; and then using unqualified names for entities which must be in the namespace std. std::Vector<int> would have given the error: 'Vector' : is not a member of 'std'
I entered the two statements into the header. It work beautifully. Thank you for your troubleshooting efforts. You got to the heart of the problem.
Now that my complier is updated and my header file is fixed, I can continue using the header file to work the rest of the problems in the book.
I skipped Chapters 12 to 16 of the book because I could not get the graphical user interface to work. I installed FLTK successfully and worked out the bugs in the header files. But, when I ran the .cpp files, I could not resolve the error messages. Please take a look at my post Window Graphics Errors. I have not received any replies so far.
Again, thank you very much. It is much appreciated.