Hello,
The folowing code compile and run well with dev-cpp 4.9.6
// essai.h file
#ifndef Essai_H
#define Essai_H
#include <vector>
using namespace std;
template<typename U> class InOut
{
private:
void cinCoutStream()
{
vector<U> vt;
copy(istream_iterator<U>(cin),
istream_iterator<U>(),
back_inserter(vt));
copy(vt.begin(),
vt.end(),
ostream_iterator<U>(cout, "\t"));
cout << endl;
}
public:
InOut(){}
~InOut(){}
void operator()()
{
cinCoutStream();
}
};
#endif //Essai_H
____________________________________________________________________________
_____________
// main.cpp file
#include <iostream>
#include <stdlib.h>
#include "essai.h"
int main(int argc, char *argv[])
{
InOut<char> cInOut;
cInOut();
system("PAUSE");
return 0;
}
____________________________________________________________________________
_____________
I have this message: " In member function 'void InOut<U>::cinCoutStream()':
line 18: parseerror befor ';' token
|