Я работаю в школьной лаборатории и в инструкции сказано:псевдоним, используя против ЬурейеЕ
Change the typedef that defines Word_List to a alias declaration (using)
Из того, что я гугле, способ сделать это, чтобы перейти от:
typedef vector<Word_Entry> Word_List;
к:
using Word_List = std::vector<Word_Entry>;
но когда я компилирую, я получаю следующую ошибку:
error: expected nested-name-specifier before 'Word_List'
Большая часть кода:
#include <iostream>
#include <algorithm>
#include <list>
#include <string>
#include <vector>
#include <fstream>
#include <cctype>
#include <iomanip>
using namespace std;
struct Word_Entry
{
string ord;
unsigned cnt;
};
//typedef vector<Word_Entry> Word_List; <-This is what it used to look like
using Word_List = vector<Word_Entry>;
int main()
{
...
}
Доп информация:
Yes, I am compiling with c++11
Word_Entry is a struct that stores 2 variables
I have the line "using namespace std;" in the begining of my code
I'm using mingw compiler
Что такое компилятор? –
Вы включили спецификацию C++ 11 в свой проект или файл makefile? – deepmax
Я добавил дополнительную информацию, отвечая на ваши вопросы. –