Changeset 35584b19 in mainline for uspace/lib/cpp/include/impl/memory.hpp
- Timestamp:
- 2018-07-05T21:41:17Z (7 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- b6d68a3
- Parents:
- de89870
- git-author:
- Jaroslav Jindrak <dzejrou@…> (2017-10-22 17:02:19)
- git-committer:
- Dzejrou <dzejrou@…> (2018-07-05 21:41:17)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/cpp/include/impl/memory.hpp
rde89870 r35584b19 39 39 */ 40 40 41 template<class T>41 template<class Ptr> 42 42 struct pointer_traits 43 43 { 44 // TODO: 44 using pointer = Ptr; 45 // TODO: element type, difference type 46 47 // TODO: this is conditional, see standard 48 template<class U> 49 using rebind = typename Ptr::template rebind<U>; 45 50 }; 46 51 … … 180 185 using pointer = typename aux::get_pointer<Alloc>::type; 181 186 using const_pointer = typename aux::get_const_pointer<Alloc, pointer>::type; 182 using void_pointer = typename aux::get_void_pointer<Alloc, pointer>::type; 183 using const_void_pointer = typename aux::get_const_void_pointer<Alloc, pointer>::type; 187 // TODO: fix void pointer typedefs 188 /* using void_pointer = typename aux::get_void_pointer<Alloc, pointer>::type; */ 189 /* using const_void_pointer = typename aux::get_const_void_pointer<Alloc, pointer>::type; */ 190 using void_pointer = void*; 191 using const_void_pointer = const void*; 184 192 using difference_type = typename aux::get_difference_type<Alloc, pointer>::type; 185 193 using size_type = typename aux::get_size_type<Alloc, difference_type>::type; … … 279 287 using is_always_equal = true_type; 280 288 281 allocator() noexcept ;282 283 allocator(const allocator&) noexcept ;289 allocator() noexcept = default; 290 291 allocator(const allocator&) noexcept = default; 284 292 285 293 template<class U> 286 allocator(const allocator<U>&) noexcept; 294 allocator(const allocator<U>&) noexcept 295 { 296 // TODO: implement 297 } 287 298 288 299 ~allocator() = default; … … 303 314 * Note: The usage of hint is unspecified. 304 315 * TODO: Check HelenOS hint allocation capabilities. 316 * TODO: assert that n < max_size() 305 317 */ 306 return ::operator new(n);318 return static_cast<pointer>(::operator new(n * sizeof(value_type))); 307 319 } 308 320
Note:
See TracChangeset
for help on using the changeset viewer.