GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
std::move_iterator::base(3) C++ Standard Libary std::move_iterator::base(3)

std::move_iterator::base - std::move_iterator::base


iterator_type base() const; (since C++11)
(until C++17)
constexpr iterator_type base() const; (1) (since C++17)
(until C++20)
constexpr const iterator_type& base() const& noexcept; (since C++20)
constexpr iterator_type base() &&; (2) (since C++20)


Returns the underlying base iterator.


1) Copy constructs the return value from the underlying iterator. (until C++20)
1) Returns a reference to the underlying iterator. (since C++20)


2) Move constructs the return value from the underlying iterator.


(none)


1) A copy of the underlying iterator. (until C++20)
1) A reference to the underlying iterator. (since C++20)


2) An iterator move constructed from the underlying iterator.


May throw implementation-defined exceptions.

// Run this code


#include <algorithm>
#include <iostream>
#include <iterator>
#include <vector>


int main()
{
std::vector<int> v{ 0, 1, 2, 3, 4 };
std::move_iterator<std::vector<int>::reverse_iterator>
m1{ v.rbegin() },
m2{ v.rend() };


std::copy(m1.base(), m2.base(), std::ostream_iterator<int>(std::cout, " "));
std::cout << '\n';
}


4 3 2 1 0


Defect reports


The following behavior-changing defect reports were applied retroactively to
previously published C++ standards.


DR Applied to Behavior as published Correct behavior
LWG 3391 C++20 the const version of base returns a copy of returns a reference
the underlying iterator
LWG 3593 C++20 the const version of base returns a made noexcept
reference but might not be noexcept


operator*
operator-> accesses the pointed-to element
(C++11) (public member function)
(C++11)(deprecated in C++20)

2022.07.31 http://cppreference.com

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.