forked from boostorg/smart_ptr
More consistency in type parameters in helper details of allocate_shared and make_shared.
[SVN r81610]
This commit is contained in:
@@ -13,8 +13,10 @@
|
||||
|
||||
namespace boost {
|
||||
namespace detail {
|
||||
template<typename A, typename T, typename Y = T>
|
||||
class allocate_array_helper {
|
||||
template<typename A, typename T, typename Y = char>
|
||||
class allocate_array_helper;
|
||||
template<typename A, typename T, typename Y>
|
||||
class allocate_array_helper<A, T[], Y> {
|
||||
template<typename A9, typename T9, typename Y9>
|
||||
friend class allocate_array_helper;
|
||||
typedef typename A::template rebind<Y> ::other A2;
|
||||
@@ -29,7 +31,7 @@ namespace boost {
|
||||
typedef typename A2::difference_type difference_type;
|
||||
template<typename U>
|
||||
struct rebind {
|
||||
typedef allocate_array_helper<A, T, U> other;
|
||||
typedef allocate_array_helper<A, T[], U> other;
|
||||
};
|
||||
allocate_array_helper(const A& allocator, std::size_t size, T** data)
|
||||
: allocator(allocator),
|
||||
@@ -37,7 +39,7 @@ namespace boost {
|
||||
data(data) {
|
||||
}
|
||||
template<class U>
|
||||
allocate_array_helper(const allocate_array_helper<A, T, U>& other)
|
||||
allocate_array_helper(const allocate_array_helper<A, T[], U>& other)
|
||||
: allocator(other.allocator),
|
||||
size(other.size),
|
||||
data(other.data) {
|
||||
@@ -75,11 +77,11 @@ namespace boost {
|
||||
allocator.destroy(memory);
|
||||
}
|
||||
template<typename U>
|
||||
bool operator==(const allocate_array_helper<A, T, U>& other) const {
|
||||
bool operator==(const allocate_array_helper<A, T[], U>& other) const {
|
||||
return allocator == other.allocator;
|
||||
}
|
||||
template<typename U>
|
||||
bool operator!=(const allocate_array_helper<A, T, U>& other) const {
|
||||
bool operator!=(const allocate_array_helper<A, T[], U>& other) const {
|
||||
return !(*this == other);
|
||||
}
|
||||
private:
|
||||
|
||||
@@ -15,7 +15,9 @@
|
||||
namespace boost {
|
||||
namespace detail {
|
||||
template<typename T>
|
||||
class array_deleter {
|
||||
class array_deleter;
|
||||
template<typename T>
|
||||
class array_deleter<T[]> {
|
||||
public:
|
||||
array_deleter()
|
||||
: size(0) {
|
||||
|
||||
@@ -13,8 +13,10 @@
|
||||
|
||||
namespace boost {
|
||||
namespace detail {
|
||||
template<typename T, typename Y = T>
|
||||
class make_array_helper {
|
||||
template<typename T, typename Y = char>
|
||||
class make_array_helper;
|
||||
template<typename T, typename Y>
|
||||
class make_array_helper<T[], Y> {
|
||||
template<typename T2, typename Y2>
|
||||
friend class make_array_helper;
|
||||
public:
|
||||
@@ -27,14 +29,14 @@ namespace boost {
|
||||
typedef ptrdiff_t difference_type;
|
||||
template<typename U>
|
||||
struct rebind {
|
||||
typedef make_array_helper<T, U> other;
|
||||
typedef make_array_helper<T[], U> other;
|
||||
};
|
||||
make_array_helper(std::size_t size, T** data)
|
||||
: size(sizeof(T) * size),
|
||||
data(data) {
|
||||
}
|
||||
template<class U>
|
||||
make_array_helper(const make_array_helper<T, U>& other)
|
||||
make_array_helper(const make_array_helper<T[], U>& other)
|
||||
: size(other.size),
|
||||
data(other.data) {
|
||||
}
|
||||
@@ -70,11 +72,11 @@ namespace boost {
|
||||
memory->~Y();
|
||||
}
|
||||
template<typename U>
|
||||
bool operator==(const make_array_helper<T, U>& other) const {
|
||||
bool operator==(const make_array_helper<T[], U>& other) const {
|
||||
return true;
|
||||
}
|
||||
template<typename U>
|
||||
bool operator!=(const make_array_helper<T, U>& other) const {
|
||||
bool operator!=(const make_array_helper<T[], U>& other) const {
|
||||
return !(*this == other);
|
||||
}
|
||||
private:
|
||||
|
||||
Reference in New Issue
Block a user