Skip to content

Instantly share code, notes, and snippets.

@jes
Forked from expipiplus1/gist:1475274
Created December 14, 2011 04:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jes/1475290 to your computer and use it in GitHub Desktop.
Save jes/1475290 to your computer and use it in GitHub Desktop.
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( ( stream_end - stream_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 nullptr;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment