Я получаю эту ошибку компилятора при вызове vector size()
. Зачем?
#include <vector>
#include <iostream>
#include <fstream>
#include <sstream>
#include <string>
#include <cassert>
using namespace std;
class Vertex {
float firstValue;
float secondValue;
float thirdValue;
Vertex (float first, float second, float third){
firstValue=first;
secondValue=second;
thirdValue=third;
}
};
int main()
{
cout<<"This program loads a 3D .off object. \nEnter the name of the file that describes it "<<endl;
string inputFileName;
getline(cin, inputFileName);
ifstream inputFileStream;
inputFileStream.open(inputFileName.data());
assert (inputFileStream.is_open());
string actualLine;
for(;;){
inputFileStream>>actualLine;
istringstream actualLineStream(actualLine);
std::vector<float> results( std::istream_iterator<int>(actualLineStream)
, std::istream_iterator<int>() );
int resultsIndex=0;
int resultsSize=results.size(); //WHY??
while (resultsIndex<resultsSize){
cout<<results[resultsIndex]<<endl;
}
if (inputFileStream.eof()) break;
}
ofstream outputChannel;
while (true){} // to keep on console view
return 0;
}