123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126 |
- #ifndef BOOST_ASIO_IP_ADDRESS_V6_RANGE_HPP
- #define BOOST_ASIO_IP_ADDRESS_V6_RANGE_HPP
- #if defined(_MSC_VER) && (_MSC_VER >= 1200)
- # pragma once
- #endif
- #include <boost/asio/detail/config.hpp>
- #include <boost/asio/ip/address_v6_iterator.hpp>
- #include <boost/asio/detail/push_options.hpp>
- namespace boost {
- namespace asio {
- namespace ip {
- template <typename> class basic_address_range;
- template <> class basic_address_range<address_v6>
- {
- public:
-
- typedef basic_address_iterator<address_v6> iterator;
-
- basic_address_range() noexcept
- : begin_(address_v6()),
- end_(address_v6())
- {
- }
-
- explicit basic_address_range(const iterator& first,
- const iterator& last) noexcept
- : begin_(first),
- end_(last)
- {
- }
-
- basic_address_range(const basic_address_range& other) noexcept
- : begin_(other.begin_),
- end_(other.end_)
- {
- }
-
- basic_address_range(basic_address_range&& other) noexcept
- : begin_(static_cast<iterator&&>(other.begin_)),
- end_(static_cast<iterator&&>(other.end_))
- {
- }
-
- basic_address_range& operator=(
- const basic_address_range& other) noexcept
- {
- begin_ = other.begin_;
- end_ = other.end_;
- return *this;
- }
-
- basic_address_range& operator=(basic_address_range&& other) noexcept
- {
- begin_ = static_cast<iterator&&>(other.begin_);
- end_ = static_cast<iterator&&>(other.end_);
- return *this;
- }
-
- iterator begin() const noexcept
- {
- return begin_;
- }
-
- iterator end() const noexcept
- {
- return end_;
- }
-
- bool empty() const noexcept
- {
- return begin_ == end_;
- }
-
- iterator find(const address_v6& addr) const noexcept
- {
- return addr >= *begin_ && addr < *end_ ? iterator(addr) : end_;
- }
- private:
- iterator begin_;
- iterator end_;
- };
- typedef basic_address_range<address_v6> address_v6_range;
- }
- }
- }
- #include <boost/asio/detail/pop_options.hpp>
- #endif
|