Skip site navigation (1)Skip section navigation (2)

FreeBSD Manual Pages

  
 
  

home | help
deductiongu...ordered_set(3)  C++ Standard Libary deductiongu...ordered_set(3)

NAME
       deductionguidesforstd::unordered_set    -    deductionguidesforstd::un-
       ordered_set

Synopsis
	  Defined in header <unordered_set>
	  template<class InputIt,

	  class	Hash = std::hash<typename
	  std::iterator_traits<InputIt>::value_type>,
	  class	Pred = std::equal_to<typename
	  std::iterator_traits<InputIt>::value_type>,
	  class		  Alloc		  =	       std::allocator<typename
       (1) (since C++17)
	  std::iterator_traits<InputIt>::value_type>>
	  unordered_set(InputIt, InputIt,
	  typename /*see below*/::size_type = /*see below*/,
	  Hash = Hash(), Pred =	Pred(),	Alloc =	Alloc())

	  -> unordered_set<typename
	  std::iterator_traits<InputIt>::value_type, Hash, Pred, Alloc>;
	  template<class T,

	  class	Hash = std::hash<T>,
	  class	Pred = std::equal_to<T>,
	  class		    Alloc	      =		    std::allocator<T>>
       (2) (since C++17)
	  unordered_set(std::initializer_list<T>,
	  typename /*see below*/::size_type = /*see below*/,
	  Hash = Hash(), Pred =	Pred(),	Alloc =	Alloc())

	  -> unordered_set<T, Hash, Pred, Alloc>;
	  template<class InputIt, class	Alloc>

	  unordered_set(InputIt, InputIt, typename /*see below*/::size_type,
	  Alloc)
	  ->						unordered_set<typename
       (3) (since C++17)
	  std::iterator_traits<InputIt>::value_type,
	  std::hash<typename std::iterator_traits<InputIt>::value_type>,
	  std::equal_to<typename std::iterator_traits<InputIt>::value_type>,

	  Alloc>;
	  template<class InputIt, class	Hash, class Alloc>

	  unordered_set(InputIt, InputIt, typename /*see below*/::size_type,
	  Hash,	Alloc)
	  ->						unordered_set<typename
       (4) (since C++17)
	  std::iterator_traits<InputIt>::value_type, Hash,

	  std::equal_to<typename std::iterator_traits<InputIt>::value_type>,
	  Allocator>;
	  template<class T, class Allocator>

	  unordered_set(std::initializer_list<T>,	 typename	 /*see
       (5) (since C++17)
	  below*/::size_type, Allocator)

	  -> unordered_set<T, std::hash<T>, std::equal_to<T>, Alloc>;
	  template<class T, class Hash,	class Alloc>

	  unordered_set(std::initializer_list<T>,	 typename	 /*see
       (6) (since C++17)
	  below*/::size_type, Hash, Alloc)

	  -> unordered_set<T, Hash, std::equal_to<T>, Alloc>;

	  These	deduction guides are provided for unordered_set	to  allow  de-
       duction from an
	  iterator  range (overloads (1,3,4)) and std::initializer_list	(over-
       loads (2,5.6)).
	  This overload	participates in	overload resolution  only  if  InputIt
       satisfies
	  LegacyInputIterator,	Alloc  satisfies  Allocator,  neither Hash nor
       Pred satisfy
	  Allocator, Hash is not an integral type

	  Note:	the extent to which the	library	determines that	 a  type  does
       not satisfy
	  LegacyInputIterator  is  unspecified,	except that as a minimum inte-
       gral types do not
	  qualify as input iterators. Likewise,	the extent to which it	deter-
       mines 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.

	  The size_type	parameter type in these	guides refers to the size_type
       member type of
	  the type deduced by the deduction guide.

Example
       // Run this code

	#include <unordered_set>
	int main() {
	   std::unordered_set  s  =  {1,2,3,4};		   // guide #2 deduces
       std::unordered_set<int>
	   std::unordered_set s2(s.begin(), s.end());	//  guide  #1  deduces
       std::unordered_set<int>
	}

http://cppreference.com		  2022.07.31	  deductiongu...ordered_set(3)

Want to link to this manual page? Use this URL:
<https://man.freebsd.org/cgi/man.cgi?query=deductionguidesforstd::unordered_set&sektion=3&manpath=FreeBSD+Ports+15.0>

home | help