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


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

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


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

示例1: variable

        explicit variable(boost::iterator_range<Iterator> const& token) :
            _position(token.begin().position())
        {
            // Remove the $ from the name
            auto it = token.begin();
            ++it;
            _name.assign(it, token.end());

            validate_name();
        }
开发者ID:iankronquist,项目名称:puppetcpp,代码行数:10,代码来源:variable.hpp

示例2: depth

    ancestor_iterator(boost::iterator_range<ParentIterator> r)
        :parent_it(r.begin()), parent_end(r.end()), depth(0) {
        if (parent_it != parent_end) {
            c.reset(new typename super::value_type(*parent_it));
            find_next_parent();
        }

    };
开发者ID:vdav,项目名称:xtpath,代码行数:8,代码来源:ancestor_iterator.hpp

示例3: found_object

 void found_object(boost::iterator_range<Iterator> m) {
     std::string s(m.begin(), m.end());
     cout << "Found object name :" << s <<endl;
     method.is_object=true;
     iface_objects.push_back( s );
     method.name = s;
     cout << method << endl;
 }
开发者ID:psoetens,项目名称:rtt2-conversion,代码行数:8,代码来源:rtt2-converter.cpp

示例4: regex

        explicit regex(boost::iterator_range<Iterator> const& token) :
            _position(token.begin().position())
        {
            auto start = token.begin();
            auto end = token.end();

            if (start != end) {
                ++start;
            }

            // Move the end to the position before the closing / character
            auto last = start;
            for (auto current = start; current != end; ++current) {
                last = current;
            }
            _value.assign(start, last);
        }
开发者ID:iankronquist,项目名称:puppetcpp,代码行数:17,代码来源:regex.hpp

示例5: string_generate

 inline bool string_generate(OutputIterator& sink
   , boost::iterator_range<Iterator> const& r, CharEncoding, Tag)
 {
     Iterator end = r.end();
     for (Iterator it = r.begin(); it != end; ++it)
     {
         *sink = spirit::char_class::convert<CharEncoding>::to(Tag(), *it);
         ++sink;
     }
     return detail::sink_is_good(sink);
 }
开发者ID:QuentinRougemont,项目名称:MicrosatDemogInference,代码行数:11,代码来源:string_generate.hpp

示例6:

 attribute_iterator(boost::iterator_range<ParentIterator> r)
     :parent_it(r.begin()), parent_end(r.end()) {
     if (parent_it != parent_end) {
         auto attributes = (*parent_it).attributes();
         attribute_it = attributes.begin();
         attribute_end = attributes.end();
         if (attribute_it == attribute_end) {
             go_to_next();
         }
     }
 }
开发者ID:vdav,项目名称:xtpath,代码行数:11,代码来源:attribute_iterator.hpp

示例7: depth

    descendant_iterator(boost::iterator_range<ParentIterator> r)
        :parent_it(r.begin()), parent_end(r.end()), depth(0) {
        if (parent_it != parent_end) {
            c.reset(new typename super::value_type(*parent_it));
            if (c->has_children()) {
                c->first_child();
                depth++;
            } else {
                find_next_leaf();
            }
        }

    };
开发者ID:vdav,项目名称:xtpath,代码行数:13,代码来源:descendant_iterator.hpp

示例8: response_callback_with_reply

// callback to receive reply from server
// reply - pointer to reply string
// cv - pointer to condition variable to notify sender with
void response_callback_with_reply(boost::iterator_range<char const *> const &a,
                                  boost::system::error_code const &error_code,
                                  std::string *reply,
                                  std::condition_variable *cv)
{
    if (!error_code) {
        //std::unique_lock<std::mutex> scoped_lock(reply_mutex);
        reply->append(a.begin());
    } else {
        if (error_code == boost::asio::error::eof) {
            // notify request sender with condition variable about transfer finish
            cv->notify_all();
        }
    }
}
开发者ID:ksergy1,项目名称:interview,代码行数:18,代码来源:client.cpp

示例9: unpackAndUncompressInteger

void unpackAndUncompressInteger(
        const boost::iterator_range<detail::ByteSequence::const_iterator>&
                range,
        Integer& value) {
    unsigned char* valuePointer = reinterpret_cast<unsigned char*>(&value);
    detail::ByteSequence::const_iterator iterator = range.begin();
    const unsigned char& size = *iterator;
    ++iterator;
    constexpr unsigned char maxSize = static_cast<unsigned char>(sizeof(value));
    unsigned char leadingZeroBytes = maxSize - size;
    PackedValue packedValue;
    unsigned char* valueArray =
            reinterpret_cast<unsigned char*>(&packedValue) + leadingZeroBytes;
    std::copy(iterator, iterator + size, valueArray);
    //value = static_cast<Integer>(packedValue - getOffset<Integer>());
}
开发者ID:andrasnemeth,项目名称:comparable-serialization,代码行数:16,代码来源:Sequentialize.hpp

示例10: unpackAndUnshiftInteger

    std::size_t unpackAndUnshiftInteger(
            const boost::iterator_range<detail::ByteSequence::const_iterator>&
                    range,
            Integer& value) {
        PackedValue packedValue = boost::endian::big_to_native(
                *reinterpret_cast<const PackedValue*>(&*range.begin()));

        if (packedValue >= getOffsetZero<PackedValue>()) {
            value = static_cast<Integer>(
                    packedValue - getOffset<Integer, PackedValue>());
        } else {
            value = static_cast<Integer>(packedValue) -
                    getOffset<Integer, PackedValue>();
        }

        return sizeof(value);
    }
开发者ID:andrasnemeth,项目名称:comparable-serialization,代码行数:17,代码来源:Sequentialize.hpp

示例11: make_tuple

			static boost::tuple< boost::iterator_range<InputIterator>, size_t >
			apply(unsigned char (&v)[N], boost::iterator_range<InputIterator> const& input){

					auto iter = input.begin();
					auto const& end = input.end();

					unsigned char * out_cur = reinterpret_cast<unsigned char*>(&v);
					unsigned char const * const out_end = out_cur+sizeof(v);

					while(out_cur !=out_end){

						if( iter==end ) STCRYPT_THROW_EXCEPTION( sio::exception::underflow() );

						*out_cur = *iter;
						++iter;
						++out_cur;
					}

					return boost::make_tuple( boost::make_iterator_range(iter, end), sizeof(v) );

			}
开发者ID:abelepereira,项目名称:stcrypt,代码行数:21,代码来源:util-sio.hpp

示例12: type

 explicit type(boost::iterator_range<Iterator> const& token) :
     _position(token.begin().position()),
     _name(token.begin(), token.end())
 {
 }
开发者ID:iankronquist,项目名称:puppetcpp,代码行数:5,代码来源:type.hpp

示例13: operator

typename std::iterator_traits<It>::value_type operator()() { return *(r_.begin() + (rand_r(&seed_) % r_.size())); }
开发者ID:alexeimoisseev,项目名称:NwSMTP,代码行数:1,代码来源:buffers.cpp

示例14: found_arg_desc

    void found_arg_desc(boost::iterator_range<Iterator> m) {
        std::string s(m.begin(), m.end());
//        cout << "Found arg desc :" << s <<endl;
        bf::get<1>(method.args.back()) = s;
    }
开发者ID:psoetens,项目名称:rtt2-conversion,代码行数:5,代码来源:rtt2-converter.cpp

示例15: found_arg

    void found_arg(boost::iterator_range<Iterator> m) {
        std::string s(m.begin(), m.end());
//        cout << "Found arg :" << s <<endl;
        method.args.push_back( arg_desc_type(s,"") );
    }
开发者ID:psoetens,项目名称:rtt2-conversion,代码行数:5,代码来源:rtt2-converter.cpp


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