C++ 11 begin() and end() functions [message #1767409] |
Wed, 05 July 2017 17:12 |
Richard Cornish Messages: 1 Registered: July 2017 |
Junior Member |
|
|
I am using Eclipse Oxygen and just tinkering around. I am attempting to compile this code:
#include <iostream>
#include <vector>
#include <list>
int main( int argc, char** argv ) {
int ia[] = { 0, 24, 98, 55, 22, 5, 8, 1, 62 };
std::vector<int> vec(ia, std::end(ia));
std::list<int> lst(ia, std::end(ia));
return 0;
}
I get the error the following errors:
Quote:
13:10:03 **** Build of configuration Debug for project array_it****
make all
Building file: ../array_it.cpp
Invoking: GCC C++ Compiler
g++ -std=c++0x -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"array_it.d" -MT"array_it.o" -o "array_it.o" "../array_it.cpp"
../array_it.cpp: In function 'int main(int, char**)':
../array_it.cpp:16: error: 'end' is not a member of 'std'
../array_it.cpp:17: error: 'end' is not a member of 'std'
make: *** [array_it.o] Error 1
13:10:03 Build Finished (took 320ms)
Any ideas why it's having a problem with the end() function? Thanks for the help in advance!
|
|
|
|
Powered by
FUDForum. Page generated in 0.02906 seconds