Hi everybody,
Please excuse the noob question as I am new to STL in C++. I am trying to write a very basic program which uses iota. However my compiler is complaining that iota does not exist in algorithm. Some other forums suggested including <backward/algo.h> as iota could have been depreciated. However my code still does not compile. Can some one take a look?
#include<iostream>
#include<vector>
#include<algorithm>
#include<iterator>
#include<backward/algo.h>
using namespace std;
int main(){
vector<int> myVector;
iota(myVector.begin(), myVector.end(),100);
copy(myVector.begin(), myVector.end(), ostream_iterator<int>(cout," "));
cout<<endl;
}
I am using g++ on Ubuntu and my compiler version is 4.4.3