-
-
Save jes/1475289 to your computer and use it in GitHub Desktop.
This file contains 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
template <std::string literal, std::string name> | |
std::unique_ptr< LiteralTerminal< literal, name > > LiteralTerminal::Parse( std::string::const_iterator& stream_begin, std::string::const_iterator stream_end ) | |
{ | |
if( ( end - begin ) < literal.size() ) | |
{ | |
if( std::equal( literal.begin(), literal.end(), stream_begin ) ) | |
{ | |
stream_begin += literal.size(); | |
return std::unique_ptr< LiteralTerminal< literal, name > >( new LiteralTerminal< literal, name > ); | |
} | |
} | |
return std::unique_ptr< LiteralTerminal< literal, name > >( nullptr ); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment