mirror of
https://github.com/topjohnwu/cxx.git
synced 2025-02-19 07:38:02 +00:00
Rename Box value_type to element_type
This matches the member type naming on unique_ptr. https://en.cppreference.com/w/cpp/memory/unique_ptr#Member_types It appears value_type is for a member type of a container or iterator while element_type is for the target of a smart pointer.
This commit is contained in:
parent
e0d2227b6f
commit
e47a4d94d0
@ -13,7 +13,7 @@
|
||||
template <typename T>
|
||||
class Box final {
|
||||
public:
|
||||
using value_type = T;
|
||||
using element_type = T;
|
||||
using const_pointer =
|
||||
typename std::add_pointer<typename std::add_const<T>::type>::type;
|
||||
using pointer = typename std::add_pointer<T>::type;
|
||||
|
@ -222,7 +222,7 @@ private:
|
||||
template <typename T>
|
||||
class Box final {
|
||||
public:
|
||||
using value_type = T;
|
||||
using element_type = T;
|
||||
using const_pointer =
|
||||
typename std::add_pointer<typename std::add_const<T>::type>::type;
|
||||
using pointer = typename std::add_pointer<T>::type;
|
||||
@ -252,6 +252,9 @@ public:
|
||||
|
||||
T *into_raw() noexcept;
|
||||
|
||||
// Deprecated.
|
||||
using value_type = element_type;
|
||||
|
||||
private:
|
||||
class uninit;
|
||||
class allocation;
|
||||
|
Loading…
x
Reference in New Issue
Block a user