|
56 | 56 |
|
57 | 57 | \pnum
|
58 | 58 | For the components affected by this subclause that declare an \tcode{allocator_type},
|
59 |
| -objects stored in these components shall be constructed using the |
60 |
| -\tcode{allocator_traits<allocator_type>::rebind_traits<U>::construct} function |
61 |
| -and destroyed using the |
62 |
| -\tcode{allocator_traits<allocator_type>::rebind_traits<U>::destroy} |
63 |
| -function~(\ref{allocator.traits.members}), |
| 59 | +objects stored in these components shall be constructed using the function |
| 60 | +\tcode{allocator_traits<allocator_type>::rebind_traits<U>::\brk{}construct} |
| 61 | +and destroyed using the function |
| 62 | +\tcode{allocator_traits<allocator_type>::rebind_traits<U>::\brk{}destroy}~(\ref{allocator.traits.members}), |
64 | 63 | where \tcode{U} is either \tcode{allocator_type::value_type} or
|
65 | 64 | an internal type used by the container.
|
66 | 65 | These functions are called only for the
|
|
1227 | 1226 |
|
1228 | 1227 | \begin{codeblock}
|
1229 | 1228 | template<@\unspecnc@>
|
1230 |
| -class @\textit{node_handle}@ { |
1231 |
| -public: |
1232 |
| - // These type declarations are described in Tables \ref{tab:containers.associative.requirements} and \ref{tab:HashRequirements} |
1233 |
| - using value_type = @\seebelownc{}@; // Not present for map containers |
1234 |
| - using key_type = @\seebelownc{}@; // Not present for set containers |
1235 |
| - using mapped_type = @\seebelownc{}@; // Not present for set containers |
1236 |
| - using allocator_type = @\seebelownc{}@; |
1237 |
| - |
1238 |
| -private: |
1239 |
| - using container_node_type = @\unspecnc@; |
1240 |
| - using ator_traits = allocator_traits<allocator_type>; |
1241 |
| - typename ator_traits::rebind_traits<container_node_type>::pointer ptr_; |
1242 |
| - optional<allocator_type> alloc_; |
1243 |
| - |
1244 |
| -public: |
1245 |
| - constexpr @\textit{node_handle}@() noexcept : ptr_(), alloc_() {} |
1246 |
| - ~@\textit{node_handle}@(); |
1247 |
| - @\textit{node_handle}@(@\textit{node_handle}@&&) noexcept; |
1248 |
| - @\textit{node_handle}@& operator=(@\textit{node_handle}@&&); |
1249 |
| - value_type& value() const; // Not present for map containers |
1250 |
| - key_type& key() const; // Not present for set containers |
1251 |
| - mapped_type& mapped() const; // Not present for set containers |
1252 |
| - allocator_type get_allocator() const; |
1253 |
| - explicit operator bool() const noexcept; |
1254 |
| - bool empty() const noexcept; |
1255 |
| - void swap(@\textit{node_handle}@&) |
1256 |
| - noexcept(ator_traits::propagate_on_container_swap::value || |
1257 |
| - ator_traits::is_always_equal::value); |
1258 |
| - friend void swap(@\textit{node_handle}@& x, @\textit{node_handle}@& y) noexcept(noexcept(x.swap(y))) |
1259 |
| - { x.swap(y); } |
| 1229 | + class @\textit{node_handle}@ { |
| 1230 | + public: |
| 1231 | + // These type declarations are described in Tables \ref{tab:containers.associative.requirements} and \ref{tab:HashRequirements}. |
| 1232 | + using value_type = @\seebelownc{}@; // not present for map containers |
| 1233 | + using key_type = @\seebelownc{}@; // not present for set containers |
| 1234 | + using mapped_type = @\seebelownc{}@; // not present for set containers |
| 1235 | + using allocator_type = @\seebelownc{}@; |
| 1236 | + |
| 1237 | + private: |
| 1238 | + using container_node_type = @\unspecnc@; |
| 1239 | + using ator_traits = allocator_traits<allocator_type>; |
| 1240 | + |
| 1241 | + typename ator_traits::rebind_traits<container_node_type>::pointer ptr_; |
| 1242 | + optional<allocator_type> alloc_; |
| 1243 | + |
| 1244 | + public: |
| 1245 | + constexpr @\textit{node_handle}@() noexcept : ptr_(), alloc_() {} |
| 1246 | + ~@\textit{node_handle}@(); |
| 1247 | + @\textit{node_handle}@(@\textit{node_handle}@&&) noexcept; |
| 1248 | + @\textit{node_handle}@& operator=(@\textit{node_handle}@&&); |
| 1249 | + |
| 1250 | + value_type& value() const; // not present for map containers |
| 1251 | + key_type& key() const; // not present for set containers |
| 1252 | + mapped_type& mapped() const; // not present for set containers |
| 1253 | + |
| 1254 | + allocator_type get_allocator() const; |
| 1255 | + explicit operator bool() const noexcept; |
| 1256 | + bool empty() const noexcept; |
| 1257 | + |
| 1258 | + void swap(@\textit{node_handle}@&) |
| 1259 | + noexcept(ator_traits::propagate_on_container_swap::value || |
| 1260 | + ator_traits::is_always_equal::value); |
| 1261 | + |
| 1262 | + friend void swap(@\textit{node_handle}@& x, @\textit{node_handle}@& y) noexcept(noexcept(x.swap(y))) { |
| 1263 | + x.swap(y); |
| 1264 | + } |
1260 | 1265 | };
|
1261 | 1266 | \end{codeblock}
|
1262 | 1267 |
|
|
1342 | 1347 |
|
1343 | 1348 | \pnum
|
1344 | 1349 | \returns A non-const reference to the \tcode{key_type} member of the
|
1345 |
| -\tcode{value_type} subobject in the \tcode{container_node_type} object |
| 1350 | +\tcode{value_type} subobject in the \tcode{contain\-er_node_type} object |
1346 | 1351 | pointed to by \tcode{ptr_}.
|
1347 | 1352 |
|
1348 | 1353 | \pnum
|
|
0 commit comments