M
Menace Denace
Hey guys, as i was just doing some small example programs i came
across an interesting feature apparently only available in the new
Microsoft Visual Studio 2010 Beta. The program is as follows
void p1()
{
cout<< "Reverse algorithm with STL containers.\n"<<endl;
vector<char> cvec = make< vector<char> >("This is a vector of
chars!");
cout<< "Size : " << cvec.size() <<endl;
reverse( cvec.begin(), cvec.end() );
cvec.push_back(0);
cout << cvec.data() <<endl;
cout<< "New Size : " << cvec.size() <<endl;
}
Id like to know why does this compile? vector does not have a data()
member as far as i know! is this some C++0x feature or just an
extension the Microsoft Compiler guys decided to add? Btw this code
will not compile on MSVC2008!
across an interesting feature apparently only available in the new
Microsoft Visual Studio 2010 Beta. The program is as follows
void p1()
{
cout<< "Reverse algorithm with STL containers.\n"<<endl;
vector<char> cvec = make< vector<char> >("This is a vector of
chars!");
cout<< "Size : " << cvec.size() <<endl;
reverse( cvec.begin(), cvec.end() );
cvec.push_back(0);
cout << cvec.data() <<endl;
cout<< "New Size : " << cvec.size() <<endl;
}
Id like to know why does this compile? vector does not have a data()
member as far as i know! is this some C++0x feature or just an
extension the Microsoft Compiler guys decided to add? Btw this code
will not compile on MSVC2008!