Created
December 25, 2011 12:26
-
-
Save mikebaldry/1519173 to your computer and use it in GitHub Desktop.
Why would resulting_command need to be declared, when declaring it?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| command_parser.cpp:13: error: ‘resulting_command’ was not declared in this scope.. | |
| command& command_parser::parse(const std::string& command) { | |
| 13: command* resulting_command = NULL; | |
| std::vector<std::string> parts; | |
| boost::split(parts, command, boost::is_any_of(" ")); | |
| std::string cmd = parts.at(0); | |
| boost::to_upper(cmd); | |
| parts.erase(parts.begin()); | |
| if (cmd == "AUTH") { | |
| resulting_command = new auth_command(); | |
| } | |
| if (resulting_command != NULL) { | |
| resulting_command.initialize(parts); | |
| } | |
| return &resulting_command; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment