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
deductionguidesforstd::deque(3) C++ Standard Libary deductionguidesforstd::deque(3)

deductionguidesforstd::deque - deductionguidesforstd::deque


Defined in header <deque>
template< class InputIt,


class Alloc = std::allocator<typename
std::iterator_traits<InputIt>::value_type>> (since C++17)
deque(InputIt, InputIt, Alloc = Alloc())


-> deque<typename std::iterator_traits<InputIt>::value_type, Alloc>;


This deduction guide is provided for deque to allow deduction from an iterator
range. This overload participates in overload resolution only if InputIt satisfies
LegacyInputIterator and Alloc satisfies Allocator.


Note: the extent to which the library determines that a type does not satisfy
LegacyInputIterator is unspecified, except that as a minimum integral types do not
qualify as input iterators. Likewise, the extent to which it determines that a type
does not satisfy Allocator is unspecified, except that as a minimum the member type
Alloc::value_type must exist and the expression
std::declval<Alloc&>().allocate(std::size_t{}) must be well-formed when treated as
an unevaluated operand.

// Run this code


#include <deque>
#include <vector>
int main() {
std::vector<int> v = {1, 2, 3, 4};


// uses explicit deduction guide to deduce std::deque<int>
std::deque x(v.begin(), v.end());


// deduces std::deque<std::vector<int>::iterator>
// first phase of overload resolution for list-initialization selects the candidate
// synthesized from the initializer-list constructor; second phase is not performed and
// deduction guide has no effect
std::deque y{v.begin(), v.end()};
}

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.