当前位置: 首页>>代码示例>>C++>>正文


C++ argument_type::begin方法代码示例

本文整理汇总了C++中argument_type::begin方法的典型用法代码示例。如果您正苦于以下问题:C++ argument_type::begin方法的具体用法?C++ argument_type::begin怎么用?C++ argument_type::begin使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在argument_type的用法示例。


在下文中一共展示了argument_type::begin方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: operator

 result_type operator()(const argument_type& range) const
 {
   size_t seed = 0;
   boost::hash_combine(seed, range.begin());
   boost::hash_combine(seed, range.end());
   return seed;
 }
开发者ID:447327642,项目名称:mesos,代码行数:7,代码来源:ip.hpp

示例2: operator

    result_type operator() (argument_type line)
    {
        // parse for our symbols
        for( std::string::size_type pos = 0; (pos = line.find('$', pos)) != std::string::npos; pos++ )
        {
            std::string::size_type end = line.find(')', pos);

            std::string::iterator it_begin = line.begin() + pos;
            std::string::iterator it_end = line.begin() + end;

            std::string statement = line.substr(pos + 2, end - pos - 2);

            // check for commands
            std::string::size_type space_pos;
            if( (space_pos = statement.find_first_of(" )", 0)) != std::string::npos )
            {
                // space must come first
                if( statement[space_pos] == ' ' )
                {
                    // push the parser for this command
                    std::string command = statement.substr(0, space_pos);
                    parsers.push_back(parser_factory(command, symbols, parsers, input, output));
                    parsers.back()->operator()(line);

                    return true;
                }
            }

            symbol_map::const_iterator sym = symbols.find(statement);
            if( sym == symbols.end() )
                throw std::runtime_error(std::string("Unknown symbol encountered: ") + statement);

            line.replace(pos, end - pos + 1, sym->second);

            pos++;
        }

        if( m_should_output )
            output << line << "\n";

        return true;
    }
开发者ID:BackupTheBerlios,项目名称:cpaf-svn,代码行数:42,代码来源:main.cpp


注:本文中的argument_type::begin方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。