unordered_node_set.hpp 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699
  1. // Copyright (C) 2022-2023 Christian Mazakas
  2. // Distributed under the Boost Software License, Version 1.0. (See accompanying
  3. // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
  4. #ifndef BOOST_UNORDERED_UNORDERED_NODE_SET_HPP_INCLUDED
  5. #define BOOST_UNORDERED_UNORDERED_NODE_SET_HPP_INCLUDED
  6. #include <boost/config.hpp>
  7. #if defined(BOOST_HAS_PRAGMA_ONCE)
  8. #pragma once
  9. #endif
  10. #include <boost/unordered/detail/foa/element_type.hpp>
  11. #include <boost/unordered/detail/foa/node_handle.hpp>
  12. #include <boost/unordered/detail/foa/node_set_types.hpp>
  13. #include <boost/unordered/detail/foa/table.hpp>
  14. #include <boost/unordered/detail/serialize_container.hpp>
  15. #include <boost/unordered/detail/type_traits.hpp>
  16. #include <boost/unordered/unordered_node_set_fwd.hpp>
  17. #include <boost/core/allocator_access.hpp>
  18. #include <boost/container_hash/hash.hpp>
  19. #include <boost/throw_exception.hpp>
  20. #include <initializer_list>
  21. #include <iterator>
  22. #include <type_traits>
  23. #include <utility>
  24. namespace boost {
  25. namespace unordered {
  26. #if defined(BOOST_MSVC)
  27. #pragma warning(push)
  28. #pragma warning(disable : 4714) /* marked as __forceinline not inlined */
  29. #endif
  30. namespace detail {
  31. template <class TypePolicy, class Allocator>
  32. struct node_set_handle
  33. : public detail::foa::node_handle_base<TypePolicy, Allocator>
  34. {
  35. private:
  36. using base_type = detail::foa::node_handle_base<TypePolicy, Allocator>;
  37. using typename base_type::type_policy;
  38. template <class Key, class Hash, class Pred, class Alloc>
  39. friend class boost::unordered::unordered_node_set;
  40. public:
  41. using value_type = typename TypePolicy::value_type;
  42. constexpr node_set_handle() noexcept = default;
  43. node_set_handle(node_set_handle&& nh) noexcept = default;
  44. node_set_handle& operator=(node_set_handle&&) noexcept = default;
  45. value_type& value() const
  46. {
  47. BOOST_ASSERT(!this->empty());
  48. return const_cast<value_type&>(this->data());
  49. }
  50. };
  51. } // namespace detail
  52. template <class Key, class Hash, class KeyEqual, class Allocator>
  53. class unordered_node_set
  54. {
  55. using set_types = detail::foa::node_set_types<Key,
  56. typename boost::allocator_void_pointer<Allocator>::type>;
  57. using table_type = detail::foa::table<set_types, Hash, KeyEqual,
  58. typename boost::allocator_rebind<Allocator,
  59. typename set_types::value_type>::type>;
  60. table_type table_;
  61. template <class K, class H, class KE, class A>
  62. bool friend operator==(unordered_node_set<K, H, KE, A> const& lhs,
  63. unordered_node_set<K, H, KE, A> const& rhs);
  64. template <class K, class H, class KE, class A, class Pred>
  65. typename unordered_node_set<K, H, KE, A>::size_type friend erase_if(
  66. unordered_node_set<K, H, KE, A>& set, Pred pred);
  67. public:
  68. using key_type = Key;
  69. using value_type = typename set_types::value_type;
  70. using init_type = typename set_types::init_type;
  71. using size_type = std::size_t;
  72. using difference_type = std::ptrdiff_t;
  73. using hasher = Hash;
  74. using key_equal = KeyEqual;
  75. using allocator_type = Allocator;
  76. using reference = value_type&;
  77. using const_reference = value_type const&;
  78. using pointer = typename boost::allocator_pointer<allocator_type>::type;
  79. using const_pointer =
  80. typename boost::allocator_const_pointer<allocator_type>::type;
  81. using iterator = typename table_type::iterator;
  82. using const_iterator = typename table_type::const_iterator;
  83. using node_type = detail::node_set_handle<set_types,
  84. typename boost::allocator_rebind<Allocator,
  85. typename set_types::value_type>::type>;
  86. using insert_return_type =
  87. detail::foa::insert_return_type<iterator, node_type>;
  88. unordered_node_set() : unordered_node_set(0) {}
  89. explicit unordered_node_set(size_type n, hasher const& h = hasher(),
  90. key_equal const& pred = key_equal(),
  91. allocator_type const& a = allocator_type())
  92. : table_(n, h, pred, a)
  93. {
  94. }
  95. unordered_node_set(size_type n, allocator_type const& a)
  96. : unordered_node_set(n, hasher(), key_equal(), a)
  97. {
  98. }
  99. unordered_node_set(size_type n, hasher const& h, allocator_type const& a)
  100. : unordered_node_set(n, h, key_equal(), a)
  101. {
  102. }
  103. template <class InputIterator>
  104. unordered_node_set(
  105. InputIterator f, InputIterator l, allocator_type const& a)
  106. : unordered_node_set(f, l, size_type(0), hasher(), key_equal(), a)
  107. {
  108. }
  109. explicit unordered_node_set(allocator_type const& a)
  110. : unordered_node_set(0, a)
  111. {
  112. }
  113. template <class Iterator>
  114. unordered_node_set(Iterator first, Iterator last, size_type n = 0,
  115. hasher const& h = hasher(), key_equal const& pred = key_equal(),
  116. allocator_type const& a = allocator_type())
  117. : unordered_node_set(n, h, pred, a)
  118. {
  119. this->insert(first, last);
  120. }
  121. template <class InputIt>
  122. unordered_node_set(
  123. InputIt first, InputIt last, size_type n, allocator_type const& a)
  124. : unordered_node_set(first, last, n, hasher(), key_equal(), a)
  125. {
  126. }
  127. template <class Iterator>
  128. unordered_node_set(Iterator first, Iterator last, size_type n,
  129. hasher const& h, allocator_type const& a)
  130. : unordered_node_set(first, last, n, h, key_equal(), a)
  131. {
  132. }
  133. unordered_node_set(unordered_node_set const& other) : table_(other.table_)
  134. {
  135. }
  136. unordered_node_set(
  137. unordered_node_set const& other, allocator_type const& a)
  138. : table_(other.table_, a)
  139. {
  140. }
  141. unordered_node_set(unordered_node_set&& other)
  142. noexcept(std::is_nothrow_move_constructible<table_type>::value)
  143. : table_(std::move(other.table_))
  144. {
  145. }
  146. unordered_node_set(unordered_node_set&& other, allocator_type const& al)
  147. : table_(std::move(other.table_), al)
  148. {
  149. }
  150. unordered_node_set(std::initializer_list<value_type> ilist,
  151. size_type n = 0, hasher const& h = hasher(),
  152. key_equal const& pred = key_equal(),
  153. allocator_type const& a = allocator_type())
  154. : unordered_node_set(ilist.begin(), ilist.end(), n, h, pred, a)
  155. {
  156. }
  157. unordered_node_set(
  158. std::initializer_list<value_type> il, allocator_type const& a)
  159. : unordered_node_set(il, size_type(0), hasher(), key_equal(), a)
  160. {
  161. }
  162. unordered_node_set(std::initializer_list<value_type> init, size_type n,
  163. allocator_type const& a)
  164. : unordered_node_set(init, n, hasher(), key_equal(), a)
  165. {
  166. }
  167. unordered_node_set(std::initializer_list<value_type> init, size_type n,
  168. hasher const& h, allocator_type const& a)
  169. : unordered_node_set(init, n, h, key_equal(), a)
  170. {
  171. }
  172. ~unordered_node_set() = default;
  173. unordered_node_set& operator=(unordered_node_set const& other)
  174. {
  175. table_ = other.table_;
  176. return *this;
  177. }
  178. unordered_node_set& operator=(unordered_node_set&& other) noexcept(
  179. noexcept(std::declval<table_type&>() = std::declval<table_type&&>()))
  180. {
  181. table_ = std::move(other.table_);
  182. return *this;
  183. }
  184. allocator_type get_allocator() const noexcept
  185. {
  186. return table_.get_allocator();
  187. }
  188. /// Iterators
  189. ///
  190. iterator begin() noexcept { return table_.begin(); }
  191. const_iterator begin() const noexcept { return table_.begin(); }
  192. const_iterator cbegin() const noexcept { return table_.cbegin(); }
  193. iterator end() noexcept { return table_.end(); }
  194. const_iterator end() const noexcept { return table_.end(); }
  195. const_iterator cend() const noexcept { return table_.cend(); }
  196. /// Capacity
  197. ///
  198. BOOST_ATTRIBUTE_NODISCARD bool empty() const noexcept
  199. {
  200. return table_.empty();
  201. }
  202. size_type size() const noexcept { return table_.size(); }
  203. size_type max_size() const noexcept { return table_.max_size(); }
  204. /// Modifiers
  205. ///
  206. void clear() noexcept { table_.clear(); }
  207. BOOST_FORCEINLINE std::pair<iterator, bool> insert(
  208. value_type const& value)
  209. {
  210. return table_.insert(value);
  211. }
  212. BOOST_FORCEINLINE std::pair<iterator, bool> insert(value_type&& value)
  213. {
  214. return table_.insert(std::move(value));
  215. }
  216. template <class K>
  217. BOOST_FORCEINLINE typename std::enable_if<
  218. detail::transparent_non_iterable<K, unordered_node_set>::value,
  219. std::pair<iterator, bool> >::type
  220. insert(K&& k)
  221. {
  222. return table_.try_emplace(std::forward<K>(k));
  223. }
  224. BOOST_FORCEINLINE iterator insert(const_iterator, value_type const& value)
  225. {
  226. return table_.insert(value).first;
  227. }
  228. BOOST_FORCEINLINE iterator insert(const_iterator, value_type&& value)
  229. {
  230. return table_.insert(std::move(value)).first;
  231. }
  232. template <class K>
  233. BOOST_FORCEINLINE typename std::enable_if<
  234. detail::transparent_non_iterable<K, unordered_node_set>::value,
  235. iterator>::type
  236. insert(const_iterator, K&& k)
  237. {
  238. return table_.try_emplace(std::forward<K>(k)).first;
  239. }
  240. template <class InputIterator>
  241. void insert(InputIterator first, InputIterator last)
  242. {
  243. for (auto pos = first; pos != last; ++pos) {
  244. table_.emplace(*pos);
  245. }
  246. }
  247. void insert(std::initializer_list<value_type> ilist)
  248. {
  249. this->insert(ilist.begin(), ilist.end());
  250. }
  251. insert_return_type insert(node_type&& nh)
  252. {
  253. if (nh.empty()) {
  254. return {end(), false, node_type{}};
  255. }
  256. BOOST_ASSERT(get_allocator() == nh.get_allocator());
  257. auto itp = table_.insert(std::move(nh.element()));
  258. if (itp.second) {
  259. nh.reset();
  260. return {itp.first, true, node_type{}};
  261. } else {
  262. return {itp.first, false, std::move(nh)};
  263. }
  264. }
  265. iterator insert(const_iterator, node_type&& nh)
  266. {
  267. if (nh.empty()) {
  268. return end();
  269. }
  270. BOOST_ASSERT(get_allocator() == nh.get_allocator());
  271. auto itp = table_.insert(std::move(nh.element()));
  272. if (itp.second) {
  273. nh.reset();
  274. return itp.first;
  275. } else {
  276. return itp.first;
  277. }
  278. }
  279. template <class... Args>
  280. BOOST_FORCEINLINE std::pair<iterator, bool> emplace(Args&&... args)
  281. {
  282. return table_.emplace(std::forward<Args>(args)...);
  283. }
  284. template <class... Args>
  285. BOOST_FORCEINLINE iterator emplace_hint(const_iterator, Args&&... args)
  286. {
  287. return table_.emplace(std::forward<Args>(args)...).first;
  288. }
  289. BOOST_FORCEINLINE typename table_type::erase_return_type erase(
  290. const_iterator pos)
  291. {
  292. return table_.erase(pos);
  293. }
  294. iterator erase(const_iterator first, const_iterator last)
  295. {
  296. while (first != last) {
  297. this->erase(first++);
  298. }
  299. return iterator{detail::foa::const_iterator_cast_tag{}, last};
  300. }
  301. BOOST_FORCEINLINE size_type erase(key_type const& key)
  302. {
  303. return table_.erase(key);
  304. }
  305. template <class K>
  306. BOOST_FORCEINLINE typename std::enable_if<
  307. detail::transparent_non_iterable<K, unordered_node_set>::value,
  308. size_type>::type
  309. erase(K const& key)
  310. {
  311. return table_.erase(key);
  312. }
  313. void swap(unordered_node_set& rhs) noexcept(
  314. noexcept(std::declval<table_type&>().swap(std::declval<table_type&>())))
  315. {
  316. table_.swap(rhs.table_);
  317. }
  318. node_type extract(const_iterator pos)
  319. {
  320. BOOST_ASSERT(pos != end());
  321. node_type nh;
  322. auto elem = table_.extract(pos);
  323. nh.emplace(std::move(elem), get_allocator());
  324. return nh;
  325. }
  326. node_type extract(key_type const& key)
  327. {
  328. auto pos = find(key);
  329. return pos != end() ? extract(pos) : node_type();
  330. }
  331. template <class K>
  332. typename std::enable_if<
  333. boost::unordered::detail::transparent_non_iterable<K,
  334. unordered_node_set>::value,
  335. node_type>::type
  336. extract(K const& key)
  337. {
  338. auto pos = find(key);
  339. return pos != end() ? extract(pos) : node_type();
  340. }
  341. template <class H2, class P2>
  342. void merge(unordered_node_set<key_type, H2, P2, allocator_type>& source)
  343. {
  344. BOOST_ASSERT(get_allocator() == source.get_allocator());
  345. table_.merge(source.table_);
  346. }
  347. template <class H2, class P2>
  348. void merge(unordered_node_set<key_type, H2, P2, allocator_type>&& source)
  349. {
  350. BOOST_ASSERT(get_allocator() == source.get_allocator());
  351. table_.merge(std::move(source.table_));
  352. }
  353. /// Lookup
  354. ///
  355. BOOST_FORCEINLINE size_type count(key_type const& key) const
  356. {
  357. auto pos = table_.find(key);
  358. return pos != table_.end() ? 1 : 0;
  359. }
  360. template <class K>
  361. BOOST_FORCEINLINE typename std::enable_if<
  362. detail::are_transparent<K, hasher, key_equal>::value, size_type>::type
  363. count(K const& key) const
  364. {
  365. auto pos = table_.find(key);
  366. return pos != table_.end() ? 1 : 0;
  367. }
  368. BOOST_FORCEINLINE iterator find(key_type const& key)
  369. {
  370. return table_.find(key);
  371. }
  372. BOOST_FORCEINLINE const_iterator find(key_type const& key) const
  373. {
  374. return table_.find(key);
  375. }
  376. template <class K>
  377. BOOST_FORCEINLINE typename std::enable_if<
  378. boost::unordered::detail::are_transparent<K, hasher, key_equal>::value,
  379. iterator>::type
  380. find(K const& key)
  381. {
  382. return table_.find(key);
  383. }
  384. template <class K>
  385. BOOST_FORCEINLINE typename std::enable_if<
  386. boost::unordered::detail::are_transparent<K, hasher, key_equal>::value,
  387. const_iterator>::type
  388. find(K const& key) const
  389. {
  390. return table_.find(key);
  391. }
  392. BOOST_FORCEINLINE bool contains(key_type const& key) const
  393. {
  394. return this->find(key) != this->end();
  395. }
  396. template <class K>
  397. BOOST_FORCEINLINE typename std::enable_if<
  398. boost::unordered::detail::are_transparent<K, hasher, key_equal>::value,
  399. bool>::type
  400. contains(K const& key) const
  401. {
  402. return this->find(key) != this->end();
  403. }
  404. std::pair<iterator, iterator> equal_range(key_type const& key)
  405. {
  406. auto pos = table_.find(key);
  407. if (pos == table_.end()) {
  408. return {pos, pos};
  409. }
  410. auto next = pos;
  411. ++next;
  412. return {pos, next};
  413. }
  414. std::pair<const_iterator, const_iterator> equal_range(
  415. key_type const& key) const
  416. {
  417. auto pos = table_.find(key);
  418. if (pos == table_.end()) {
  419. return {pos, pos};
  420. }
  421. auto next = pos;
  422. ++next;
  423. return {pos, next};
  424. }
  425. template <class K>
  426. typename std::enable_if<
  427. detail::are_transparent<K, hasher, key_equal>::value,
  428. std::pair<iterator, iterator> >::type
  429. equal_range(K const& key)
  430. {
  431. auto pos = table_.find(key);
  432. if (pos == table_.end()) {
  433. return {pos, pos};
  434. }
  435. auto next = pos;
  436. ++next;
  437. return {pos, next};
  438. }
  439. template <class K>
  440. typename std::enable_if<
  441. detail::are_transparent<K, hasher, key_equal>::value,
  442. std::pair<const_iterator, const_iterator> >::type
  443. equal_range(K const& key) const
  444. {
  445. auto pos = table_.find(key);
  446. if (pos == table_.end()) {
  447. return {pos, pos};
  448. }
  449. auto next = pos;
  450. ++next;
  451. return {pos, next};
  452. }
  453. /// Hash Policy
  454. ///
  455. size_type bucket_count() const noexcept { return table_.capacity(); }
  456. float load_factor() const noexcept { return table_.load_factor(); }
  457. float max_load_factor() const noexcept
  458. {
  459. return table_.max_load_factor();
  460. }
  461. void max_load_factor(float) {}
  462. size_type max_load() const noexcept { return table_.max_load(); }
  463. void rehash(size_type n) { table_.rehash(n); }
  464. void reserve(size_type n) { table_.reserve(n); }
  465. /// Observers
  466. ///
  467. hasher hash_function() const { return table_.hash_function(); }
  468. key_equal key_eq() const { return table_.key_eq(); }
  469. };
  470. template <class Key, class Hash, class KeyEqual, class Allocator>
  471. bool operator==(
  472. unordered_node_set<Key, Hash, KeyEqual, Allocator> const& lhs,
  473. unordered_node_set<Key, Hash, KeyEqual, Allocator> const& rhs)
  474. {
  475. return lhs.table_ == rhs.table_;
  476. }
  477. template <class Key, class Hash, class KeyEqual, class Allocator>
  478. bool operator!=(
  479. unordered_node_set<Key, Hash, KeyEqual, Allocator> const& lhs,
  480. unordered_node_set<Key, Hash, KeyEqual, Allocator> const& rhs)
  481. {
  482. return !(lhs == rhs);
  483. }
  484. template <class Key, class Hash, class KeyEqual, class Allocator>
  485. void swap(unordered_node_set<Key, Hash, KeyEqual, Allocator>& lhs,
  486. unordered_node_set<Key, Hash, KeyEqual, Allocator>& rhs)
  487. noexcept(noexcept(lhs.swap(rhs)))
  488. {
  489. lhs.swap(rhs);
  490. }
  491. template <class Key, class Hash, class KeyEqual, class Allocator,
  492. class Pred>
  493. typename unordered_node_set<Key, Hash, KeyEqual, Allocator>::size_type
  494. erase_if(unordered_node_set<Key, Hash, KeyEqual, Allocator>& set, Pred pred)
  495. {
  496. return erase_if(set.table_, pred);
  497. }
  498. template <class Archive, class Key, class Hash, class KeyEqual,
  499. class Allocator>
  500. void serialize(Archive& ar,
  501. unordered_node_set<Key, Hash, KeyEqual, Allocator>& set,
  502. unsigned int version)
  503. {
  504. detail::serialize_container(ar, set, version);
  505. }
  506. #if defined(BOOST_MSVC)
  507. #pragma warning(pop) /* C4714 */
  508. #endif
  509. #if BOOST_UNORDERED_TEMPLATE_DEDUCTION_GUIDES
  510. template <class InputIterator,
  511. class Hash =
  512. boost::hash<typename std::iterator_traits<InputIterator>::value_type>,
  513. class Pred =
  514. std::equal_to<typename std::iterator_traits<InputIterator>::value_type>,
  515. class Allocator = std::allocator<
  516. typename std::iterator_traits<InputIterator>::value_type>,
  517. class = std::enable_if_t<detail::is_input_iterator_v<InputIterator> >,
  518. class = std::enable_if_t<detail::is_hash_v<Hash> >,
  519. class = std::enable_if_t<detail::is_pred_v<Pred> >,
  520. class = std::enable_if_t<detail::is_allocator_v<Allocator> > >
  521. unordered_node_set(InputIterator, InputIterator,
  522. std::size_t = boost::unordered::detail::foa::default_bucket_count,
  523. Hash = Hash(), Pred = Pred(), Allocator = Allocator())
  524. -> unordered_node_set<
  525. typename std::iterator_traits<InputIterator>::value_type, Hash, Pred,
  526. Allocator>;
  527. template <class T, class Hash = boost::hash<T>,
  528. class Pred = std::equal_to<T>, class Allocator = std::allocator<T>,
  529. class = std::enable_if_t<detail::is_hash_v<Hash> >,
  530. class = std::enable_if_t<detail::is_pred_v<Pred> >,
  531. class = std::enable_if_t<detail::is_allocator_v<Allocator> > >
  532. unordered_node_set(std::initializer_list<T>,
  533. std::size_t = boost::unordered::detail::foa::default_bucket_count,
  534. Hash = Hash(), Pred = Pred(), Allocator = Allocator())
  535. -> unordered_node_set<T, Hash, Pred, Allocator>;
  536. template <class InputIterator, class Allocator,
  537. class = std::enable_if_t<detail::is_input_iterator_v<InputIterator> >,
  538. class = std::enable_if_t<detail::is_allocator_v<Allocator> > >
  539. unordered_node_set(InputIterator, InputIterator, std::size_t, Allocator)
  540. -> unordered_node_set<
  541. typename std::iterator_traits<InputIterator>::value_type,
  542. boost::hash<typename std::iterator_traits<InputIterator>::value_type>,
  543. std::equal_to<typename std::iterator_traits<InputIterator>::value_type>,
  544. Allocator>;
  545. template <class InputIterator, class Hash, class Allocator,
  546. class = std::enable_if_t<detail::is_hash_v<Hash> >,
  547. class = std::enable_if_t<detail::is_input_iterator_v<InputIterator> >,
  548. class = std::enable_if_t<detail::is_allocator_v<Allocator> > >
  549. unordered_node_set(
  550. InputIterator, InputIterator, std::size_t, Hash, Allocator)
  551. -> unordered_node_set<
  552. typename std::iterator_traits<InputIterator>::value_type, Hash,
  553. std::equal_to<typename std::iterator_traits<InputIterator>::value_type>,
  554. Allocator>;
  555. template <class T, class Allocator,
  556. class = std::enable_if_t<detail::is_allocator_v<Allocator> > >
  557. unordered_node_set(std::initializer_list<T>, std::size_t, Allocator)
  558. -> unordered_node_set<T, boost::hash<T>, std::equal_to<T>, Allocator>;
  559. template <class T, class Hash, class Allocator,
  560. class = std::enable_if_t<detail::is_hash_v<Hash> >,
  561. class = std::enable_if_t<detail::is_allocator_v<Allocator> > >
  562. unordered_node_set(std::initializer_list<T>, std::size_t, Hash, Allocator)
  563. -> unordered_node_set<T, Hash, std::equal_to<T>, Allocator>;
  564. template <class InputIterator, class Allocator,
  565. class = std::enable_if_t<detail::is_input_iterator_v<InputIterator> >,
  566. class = std::enable_if_t<detail::is_allocator_v<Allocator> > >
  567. unordered_node_set(InputIterator, InputIterator, Allocator)
  568. -> unordered_node_set<
  569. typename std::iterator_traits<InputIterator>::value_type,
  570. boost::hash<typename std::iterator_traits<InputIterator>::value_type>,
  571. std::equal_to<typename std::iterator_traits<InputIterator>::value_type>,
  572. Allocator>;
  573. template <class T, class Allocator,
  574. class = std::enable_if_t<detail::is_allocator_v<Allocator> > >
  575. unordered_node_set(std::initializer_list<T>, Allocator)
  576. -> unordered_node_set<T, boost::hash<T>, std::equal_to<T>, Allocator>;
  577. #endif
  578. } // namespace unordered
  579. } // namespace boost
  580. #endif