Borderou de evaluare (job #2872055)
Utilizator | Data | 16 martie 2022 11:37:16 | |
---|---|---|---|
Problema | Evaluarea unei expresii | Status | done |
Runda | Arhiva educationala | Compilator | cpp-64 | Vezi sursa |
Scor | 0 |
Raport evaluator
Eroare de compilare:
main.cpp:9:20: error: 'variant' in namespace 'std' does not name a template type
9 | using Token = std::variant<Operator, int>;
| ^~~~~~~
main.cpp:9:15: note: 'std::variant' is only available from C++17 onwards
9 | using Token = std::variant<Operator, int>;
| ^~~
main.cpp:26:13: error: 'Token' was not declared in this scope
26 | std::vector<Token> tokenize(const std::string &str) {
| ^~~~~
main.cpp:26:18: error: template argument 1 is invalid
26 | std::vector<Token> tokenize(const std::string &str) {
| ^
main.cpp:26:18: error: template argument 2 is invalid
main.cpp: In function 'int tokenize(const string&)':
main.cpp:27:17: error: 'Token' was not declared in this scope
27 | std::vector<Token> tokens;
| ^~~~~
main.cpp:27:22: error: template argument 1 is invalid
27 | std::vector<Token> tokens;
| ^
main.cpp:27:22: error: template argument 2 is invalid
main.cpp:29:10: error: 'optional' is not a member of 'std'
29 | std::optional<int> num_builder = {};
| ^~~~~~~~
main.cpp:29:10: note: 'std::optional' is only available from C++17 onwards
main.cpp:29:19: error: expected primary-expression before 'int'
29 | std::optional<int> num_builder = {};
| ^~~
main.cpp:32:13: error: 'num_builder' was not declared in this scope
32 | num_builder = num_builder.value_or(0) * 10 + (c - '0');
| ^~~~~~~~~~~
main.cpp:34:17: error: 'num_builder' was not declared in this scope
34 | if (num_builder.has_value()) {
| ^~~~~~~~~~~
main.cpp:35:24: error: request for member 'push_back' in 'tokens', which is of non-class type 'int'
35 | tokens.push_back(num_builder.value());
| ^~~~~~~~~
main.cpp:41:24: error: request for member 'push_back' in 'tokens', which is of non-class type 'int'
41 | tokens.push_back(Add);
| ^~~~~~~~~
main.cpp:44:24: error: request for member 'push_back' in 'tokens', which is of non-class type 'int'
44 | tokens.push_back(Sub);
| ^~~~~~~~~
main.cpp:47:24: error: request for member 'push_back' in 'tokens', which is of non-class type 'int'
47 | tokens.push_back(Mul);
| ^~~~~~~~~
main.cpp:50:24: error: request for member 'push_back' in 'tokens', which is of non-class type 'int'
50 | tokens.push_back(Div);
| ^~~~~~~~~
main.cpp:53:24: error: request for member 'push_back' in 'tokens', which is of non-class type 'int'
Non zero exit status: 1
Ceva nu functioneaza?
- Citeste despre borderoul de evaluare.
- Daca tot nu e bine, contacteaza-ne pe forum !