1 // unique_ptr implementation -*- C++ -*-
3 // Copyright (C) 2008-2014 Free Software Foundation, Inc.
5 // This file is part of the GNU ISO C++ Library. This library is free
6 // software; you can redistribute it and/or modify it under the
7 // terms of the GNU General Public License as published by the
8 // Free Software Foundation; either version 3, or (at your option)
11 // This library is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 // GNU General Public License for more details.
16 // Under Section 7 of GPL version 3, you are granted additional
17 // permissions described in the GCC Runtime Library Exception, version
18 // 3.1, as published by the Free Software Foundation.
20 // You should have received a copy of the GNU General Public License and
21 // a copy of the GCC Runtime Library Exception along with this program;
22 // see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
23 // <http://www.gnu.org/licenses/>.
25 /** @file bits/unique_ptr.h
26 * This is an internal header file, included by other library headers.
27 * Do not attempt to use it directly. @headername{memory}
31 #define _UNIQUE_PTR_H 1
33 #include <bits/c++config.h>
34 #include <debug/debug.h>
35 #include <type_traits>
39 namespace std
_GLIBCXX_VISIBILITY(default)
41 _GLIBCXX_BEGIN_NAMESPACE_VERSION
44 * @addtogroup pointer_abstractions
48 #if _GLIBCXX_USE_DEPRECATED
49 template<typename
> class auto_ptr
;
52 /// Primary template of default_delete, used by unique_ptr
53 template<typename _Tp
>
56 /// Default constructor
57 constexpr default_delete() noexcept
= default;
59 /** @brief Converting constructor.
61 * Allows conversion from a deleter for arrays of another type, @p _Up,
62 * only if @p _Up* is convertible to @p _Tp*.
64 template<typename _Up
, typename
= typename
65 enable_if
<is_convertible
<_Up
*, _Tp
*>::value
>::type
>
66 default_delete(const default_delete
<_Up
>&) noexcept
{ }
68 /// Calls @c delete @p __ptr
70 operator()(_Tp
* __ptr
) const
72 static_assert(!is_void
<_Tp
>::value
,
73 "can't delete pointer to incomplete type");
74 static_assert(sizeof(_Tp
)>0,
75 "can't delete pointer to incomplete type");
80 // _GLIBCXX_RESOLVE_LIB_DEFECTS
81 // DR 740 - omit specialization for array objects with a compile time length
82 /// Specialization for arrays, default_delete.
83 template<typename _Tp
>
84 struct default_delete
<_Tp
[]>
87 template<typename _Up
>
88 using __remove_cv
= typename remove_cv
<_Up
>::type
;
90 // Like is_base_of<_Tp, _Up> but false if unqualified types are the same
91 template<typename _Up
>
93 = __and_
< is_base_of
<_Tp
, _Up
>,
94 __not_
<is_same
<__remove_cv
<_Tp
>, __remove_cv
<_Up
>>> >;
97 /// Default constructor
98 constexpr default_delete() noexcept
= default;
100 /** @brief Converting constructor.
102 * Allows conversion from a deleter for arrays of another type, such as
103 * a const-qualified version of @p _Tp.
105 * Conversions from types derived from @c _Tp are not allowed because
106 * it is unsafe to @c delete[] an array of derived types through a
107 * pointer to the base type.
109 template<typename _Up
, typename
= typename
110 enable_if
<!__is_derived_Tp
<_Up
>::value
>::type
>
111 default_delete(const default_delete
<_Up
[]>&) noexcept
{ }
113 /// Calls @c delete[] @p __ptr
115 operator()(_Tp
* __ptr
) const
117 static_assert(sizeof(_Tp
)>0,
118 "can't delete pointer to incomplete type");
122 template<typename _Up
>
123 typename enable_if
<__is_derived_Tp
<_Up
>::value
>::type
124 operator()(_Up
*) const = delete;
127 /// 20.7.1.2 unique_ptr for single objects.
128 template <typename _Tp
, typename _Dp
= default_delete
<_Tp
> >
131 // use SFINAE to determine whether _Del::pointer exists
134 template<typename _Up
>
135 static typename
_Up::pointer
__test(typename
_Up::pointer
*);
137 template<typename _Up
>
138 static _Tp
* __test(...);
140 typedef typename remove_reference
<_Dp
>::type _Del
;
143 typedef decltype(__test
<_Del
>(0)) type
;
146 typedef std::tuple
<typename
_Pointer::type
, _Dp
> __tuple_type
;
150 typedef typename
_Pointer::type pointer
;
151 typedef _Tp element_type
;
152 typedef _Dp deleter_type
;
156 /// Default constructor, creates a unique_ptr that owns nothing.
157 constexpr unique_ptr() noexcept
159 { static_assert(!is_pointer
<deleter_type
>::value
,
160 "constructed with null function pointer deleter"); }
162 /** Takes ownership of a pointer.
164 * @param __p A pointer to an object of @c element_type
166 * The deleter will be value-initialized.
169 unique_ptr(pointer __p
) noexcept
170 : _M_t(__p
, deleter_type())
171 { static_assert(!is_pointer
<deleter_type
>::value
,
172 "constructed with null function pointer deleter"); }
174 /** Takes ownership of a pointer.
176 * @param __p A pointer to an object of @c element_type
177 * @param __d A reference to a deleter.
179 * The deleter will be initialized with @p __d
181 unique_ptr(pointer __p
,
182 typename conditional
<is_reference
<deleter_type
>::value
,
183 deleter_type
, const deleter_type
&>::type __d
) noexcept
186 /** Takes ownership of a pointer.
188 * @param __p A pointer to an object of @c element_type
189 * @param __d An rvalue reference to a deleter.
191 * The deleter will be initialized with @p std::move(__d)
193 unique_ptr(pointer __p
,
194 typename remove_reference
<deleter_type
>::type
&& __d
) noexcept
195 : _M_t(std::move(__p
), std::move(__d
))
196 { static_assert(!std::is_reference
<deleter_type
>::value
,
197 "rvalue deleter bound to reference"); }
199 /// Creates a unique_ptr that owns nothing.
200 constexpr unique_ptr(nullptr_t
) noexcept
: unique_ptr() { }
202 // Move constructors.
204 /// Move constructor.
205 unique_ptr(unique_ptr
&& __u
) noexcept
206 : _M_t(__u
.release(), std::forward
<deleter_type
>(__u
.get_deleter())) { }
208 /** @brief Converting constructor from another type
210 * Requires that the pointer owned by @p __u is convertible to the
211 * type of pointer owned by this object, @p __u does not own an array,
212 * and @p __u has a compatible deleter type.
214 template<typename _Up
, typename _Ep
, typename
= _Require
<
215 is_convertible
<typename unique_ptr
<_Up
, _Ep
>::pointer
, pointer
>,
216 __not_
<is_array
<_Up
>>,
217 typename conditional
<is_reference
<_Dp
>::value
,
219 is_convertible
<_Ep
, _Dp
>>::type
>>
220 unique_ptr(unique_ptr
<_Up
, _Ep
>&& __u
) noexcept
221 : _M_t(__u
.release(), std::forward
<_Ep
>(__u
.get_deleter()))
224 #if _GLIBCXX_USE_DEPRECATED
225 /// Converting constructor from @c auto_ptr
226 template<typename _Up
, typename
= _Require
<
227 is_convertible
<_Up
*, _Tp
*>, is_same
<_Dp
, default_delete
<_Tp
>>>>
228 unique_ptr(auto_ptr
<_Up
>&& __u
) noexcept
;
231 /// Destructor, invokes the deleter if the stored pointer is not null.
232 ~unique_ptr() noexcept
234 auto& __ptr
= std::get
<0>(_M_t
);
235 if (__ptr
!= nullptr)
236 get_deleter()(__ptr
);
242 /** @brief Move assignment operator.
244 * @param __u The object to transfer ownership from.
246 * Invokes the deleter first if this object owns a pointer.
249 operator=(unique_ptr
&& __u
) noexcept
251 reset(__u
.release());
252 get_deleter() = std::forward
<deleter_type
>(__u
.get_deleter());
256 /** @brief Assignment from another type.
258 * @param __u The object to transfer ownership from, which owns a
259 * convertible pointer to a non-array object.
261 * Invokes the deleter first if this object owns a pointer.
263 template<typename _Up
, typename _Ep
>
264 typename enable_if
< __and_
<
265 is_convertible
<typename unique_ptr
<_Up
, _Ep
>::pointer
, pointer
>,
266 __not_
<is_array
<_Up
>>
269 operator=(unique_ptr
<_Up
, _Ep
>&& __u
) noexcept
271 reset(__u
.release());
272 get_deleter() = std::forward
<_Ep
>(__u
.get_deleter());
276 /// Reset the %unique_ptr to empty, invoking the deleter if necessary.
278 operator=(nullptr_t
) noexcept
286 /// Dereference the stored pointer.
287 typename add_lvalue_reference
<element_type
>::type
290 _GLIBCXX_DEBUG_ASSERT(get() != pointer());
294 /// Return the stored pointer.
296 operator->() const noexcept
298 _GLIBCXX_DEBUG_ASSERT(get() != pointer());
302 /// Return the stored pointer.
305 { return std::get
<0>(_M_t
); }
307 /// Return a reference to the stored deleter.
309 get_deleter() noexcept
310 { return std::get
<1>(_M_t
); }
312 /// Return a reference to the stored deleter.
314 get_deleter() const noexcept
315 { return std::get
<1>(_M_t
); }
317 /// Return @c true if the stored pointer is not null.
318 explicit operator bool() const noexcept
319 { return get() == pointer() ? false : true; }
323 /// Release ownership of any stored pointer.
328 std::get
<0>(_M_t
) = pointer();
332 /** @brief Replace the stored pointer.
334 * @param __p The new pointer to store.
336 * The deleter will be invoked if a pointer is already owned.
339 reset(pointer __p
= pointer()) noexcept
342 swap(std::get
<0>(_M_t
), __p
);
343 if (__p
!= pointer())
347 /// Exchange the pointer and deleter with another object.
349 swap(unique_ptr
& __u
) noexcept
352 swap(_M_t
, __u
._M_t
);
355 // Disable copy from lvalue.
356 unique_ptr(const unique_ptr
&) = delete;
357 unique_ptr
& operator=(const unique_ptr
&) = delete;
360 /// 20.7.1.3 unique_ptr for array objects with a runtime length
361 // [unique.ptr.runtime]
362 // _GLIBCXX_RESOLVE_LIB_DEFECTS
363 // DR 740 - omit specialization for array objects with a compile time length
364 template<typename _Tp
, typename _Dp
>
365 class unique_ptr
<_Tp
[], _Dp
>
367 // use SFINAE to determine whether _Del::pointer exists
370 template<typename _Up
>
371 static typename
_Up::pointer
__test(typename
_Up::pointer
*);
373 template<typename _Up
>
374 static _Tp
* __test(...);
376 typedef typename remove_reference
<_Dp
>::type _Del
;
379 typedef decltype(__test
<_Del
>(0)) type
;
382 typedef std::tuple
<typename
_Pointer::type
, _Dp
> __tuple_type
;
385 template<typename _Up
>
386 using __remove_cv
= typename remove_cv
<_Up
>::type
;
388 // like is_base_of<_Tp, _Up> but false if unqualified types are the same
389 template<typename _Up
>
390 using __is_derived_Tp
391 = __and_
< is_base_of
<_Tp
, _Up
>,
392 __not_
<is_same
<__remove_cv
<_Tp
>, __remove_cv
<_Up
>>> >;
394 template<typename _Up
, typename _Ep
,
395 typename _Tp_pointer
= typename
_Pointer::type
,
396 typename _Up_pointer
= typename unique_ptr
<_Up
, _Ep
>::pointer
>
397 using __safe_conversion
= __and_
<
398 is_convertible
<_Up_pointer
, _Tp_pointer
>,
400 __or_
<__not_
<is_pointer
<_Up_pointer
>>,
401 __not_
<is_pointer
<_Tp_pointer
>>,
402 __not_
<__is_derived_Tp
<typename remove_extent
<_Up
>::type
>>
407 typedef typename
_Pointer::type pointer
;
408 typedef _Tp element_type
;
409 typedef _Dp deleter_type
;
413 /// Default constructor, creates a unique_ptr that owns nothing.
414 constexpr unique_ptr() noexcept
416 { static_assert(!std::is_pointer
<deleter_type
>::value
,
417 "constructed with null function pointer deleter"); }
419 /** Takes ownership of a pointer.
421 * @param __p A pointer to an array of @c element_type
423 * The deleter will be value-initialized.
426 unique_ptr(pointer __p
) noexcept
427 : _M_t(__p
, deleter_type())
428 { static_assert(!is_pointer
<deleter_type
>::value
,
429 "constructed with null function pointer deleter"); }
431 // Disable construction from convertible pointer types.
432 template<typename _Up
, typename
= _Require
<is_pointer
<pointer
>,
433 is_convertible
<_Up
*, pointer
>, __is_derived_Tp
<_Up
>>>
435 unique_ptr(_Up
* __p
) = delete;
437 /** Takes ownership of a pointer.
439 * @param __p A pointer to an array of @c element_type
440 * @param __d A reference to a deleter.
442 * The deleter will be initialized with @p __d
444 unique_ptr(pointer __p
,
445 typename conditional
<is_reference
<deleter_type
>::value
,
446 deleter_type
, const deleter_type
&>::type __d
) noexcept
449 /** Takes ownership of a pointer.
451 * @param __p A pointer to an array of @c element_type
452 * @param __d A reference to a deleter.
454 * The deleter will be initialized with @p std::move(__d)
456 unique_ptr(pointer __p
, typename
457 remove_reference
<deleter_type
>::type
&& __d
) noexcept
458 : _M_t(std::move(__p
), std::move(__d
))
459 { static_assert(!is_reference
<deleter_type
>::value
,
460 "rvalue deleter bound to reference"); }
462 /// Move constructor.
463 unique_ptr(unique_ptr
&& __u
) noexcept
464 : _M_t(__u
.release(), std::forward
<deleter_type
>(__u
.get_deleter())) { }
466 /// Creates a unique_ptr that owns nothing.
467 constexpr unique_ptr(nullptr_t
) noexcept
: unique_ptr() { }
469 template<typename _Up
, typename _Ep
,
470 typename
= _Require
<__safe_conversion
<_Up
, _Ep
>,
471 typename conditional
<is_reference
<_Dp
>::value
,
473 is_convertible
<_Ep
, _Dp
>>::type
475 unique_ptr(unique_ptr
<_Up
, _Ep
>&& __u
) noexcept
476 : _M_t(__u
.release(), std::forward
<_Ep
>(__u
.get_deleter()))
479 /// Destructor, invokes the deleter if the stored pointer is not null.
482 auto& __ptr
= std::get
<0>(_M_t
);
483 if (__ptr
!= nullptr)
484 get_deleter()(__ptr
);
490 /** @brief Move assignment operator.
492 * @param __u The object to transfer ownership from.
494 * Invokes the deleter first if this object owns a pointer.
497 operator=(unique_ptr
&& __u
) noexcept
499 reset(__u
.release());
500 get_deleter() = std::forward
<deleter_type
>(__u
.get_deleter());
504 /** @brief Assignment from another type.
506 * @param __u The object to transfer ownership from, which owns a
507 * convertible pointer to an array object.
509 * Invokes the deleter first if this object owns a pointer.
511 template<typename _Up
, typename _Ep
>
513 enable_if
<__safe_conversion
<_Up
, _Ep
>::value
, unique_ptr
&>::type
514 operator=(unique_ptr
<_Up
, _Ep
>&& __u
) noexcept
516 reset(__u
.release());
517 get_deleter() = std::forward
<_Ep
>(__u
.get_deleter());
521 /// Reset the %unique_ptr to empty, invoking the deleter if necessary.
523 operator=(nullptr_t
) noexcept
531 /// Access an element of owned array.
532 typename
std::add_lvalue_reference
<element_type
>::type
533 operator[](size_t __i
) const
535 _GLIBCXX_DEBUG_ASSERT(get() != pointer());
539 /// Return the stored pointer.
542 { return std::get
<0>(_M_t
); }
544 /// Return a reference to the stored deleter.
546 get_deleter() noexcept
547 { return std::get
<1>(_M_t
); }
549 /// Return a reference to the stored deleter.
551 get_deleter() const noexcept
552 { return std::get
<1>(_M_t
); }
554 /// Return @c true if the stored pointer is not null.
555 explicit operator bool() const noexcept
556 { return get() == pointer() ? false : true; }
560 /// Release ownership of any stored pointer.
565 std::get
<0>(_M_t
) = pointer();
569 /** @brief Replace the stored pointer.
571 * @param __p The new pointer to store.
573 * The deleter will be invoked if a pointer is already owned.
576 reset(pointer __p
= pointer()) noexcept
579 swap(std::get
<0>(_M_t
), __p
);
584 // Disable resetting from convertible pointer types.
585 template<typename _Up
, typename
= _Require
<is_pointer
<pointer
>,
586 is_convertible
<_Up
*, pointer
>, __is_derived_Tp
<_Up
>>>
587 void reset(_Up
*) = delete;
589 /// Exchange the pointer and deleter with another object.
591 swap(unique_ptr
& __u
) noexcept
594 swap(_M_t
, __u
._M_t
);
597 // Disable copy from lvalue.
598 unique_ptr(const unique_ptr
&) = delete;
599 unique_ptr
& operator=(const unique_ptr
&) = delete;
601 // Disable construction from convertible pointer types.
602 template<typename _Up
, typename
= _Require
<is_pointer
<pointer
>,
603 is_convertible
<_Up
*, pointer
>, __is_derived_Tp
<_Up
>>>
604 unique_ptr(_Up
*, typename
605 conditional
<is_reference
<deleter_type
>::value
,
606 deleter_type
, const deleter_type
&>::type
) = delete;
608 // Disable construction from convertible pointer types.
609 template<typename _Up
, typename
= _Require
<is_pointer
<pointer
>,
610 is_convertible
<_Up
*, pointer
>, __is_derived_Tp
<_Up
>>>
611 unique_ptr(_Up
*, typename
612 remove_reference
<deleter_type
>::type
&&) = delete;
615 template<typename _Tp
, typename _Dp
>
617 swap(unique_ptr
<_Tp
, _Dp
>& __x
,
618 unique_ptr
<_Tp
, _Dp
>& __y
) noexcept
621 template<typename _Tp
, typename _Dp
,
622 typename _Up
, typename _Ep
>
624 operator==(const unique_ptr
<_Tp
, _Dp
>& __x
,
625 const unique_ptr
<_Up
, _Ep
>& __y
)
626 { return __x
.get() == __y
.get(); }
628 template<typename _Tp
, typename _Dp
>
630 operator==(const unique_ptr
<_Tp
, _Dp
>& __x
, nullptr_t
) noexcept
633 template<typename _Tp
, typename _Dp
>
635 operator==(nullptr_t
, const unique_ptr
<_Tp
, _Dp
>& __x
) noexcept
638 template<typename _Tp
, typename _Dp
,
639 typename _Up
, typename _Ep
>
641 operator!=(const unique_ptr
<_Tp
, _Dp
>& __x
,
642 const unique_ptr
<_Up
, _Ep
>& __y
)
643 { return __x
.get() != __y
.get(); }
645 template<typename _Tp
, typename _Dp
>
647 operator!=(const unique_ptr
<_Tp
, _Dp
>& __x
, nullptr_t
) noexcept
648 { return (bool)__x
; }
650 template<typename _Tp
, typename _Dp
>
652 operator!=(nullptr_t
, const unique_ptr
<_Tp
, _Dp
>& __x
) noexcept
653 { return (bool)__x
; }
655 template<typename _Tp
, typename _Dp
,
656 typename _Up
, typename _Ep
>
658 operator<(const unique_ptr
<_Tp
, _Dp
>& __x
,
659 const unique_ptr
<_Up
, _Ep
>& __y
)
662 std::common_type
<typename unique_ptr
<_Tp
, _Dp
>::pointer
,
663 typename unique_ptr
<_Up
, _Ep
>::pointer
>::type _CT
;
664 return std::less
<_CT
>()(__x
.get(), __y
.get());
667 template<typename _Tp
, typename _Dp
>
669 operator<(const unique_ptr
<_Tp
, _Dp
>& __x
, nullptr_t
)
670 { return std::less
<typename unique_ptr
<_Tp
, _Dp
>::pointer
>()(__x
.get(),
673 template<typename _Tp
, typename _Dp
>
675 operator<(nullptr_t
, const unique_ptr
<_Tp
, _Dp
>& __x
)
676 { return std::less
<typename unique_ptr
<_Tp
, _Dp
>::pointer
>()(nullptr,
679 template<typename _Tp
, typename _Dp
,
680 typename _Up
, typename _Ep
>
682 operator<=(const unique_ptr
<_Tp
, _Dp
>& __x
,
683 const unique_ptr
<_Up
, _Ep
>& __y
)
684 { return !(__y
< __x
); }
686 template<typename _Tp
, typename _Dp
>
688 operator<=(const unique_ptr
<_Tp
, _Dp
>& __x
, nullptr_t
)
689 { return !(nullptr < __x
); }
691 template<typename _Tp
, typename _Dp
>
693 operator<=(nullptr_t
, const unique_ptr
<_Tp
, _Dp
>& __x
)
694 { return !(__x
< nullptr); }
696 template<typename _Tp
, typename _Dp
,
697 typename _Up
, typename _Ep
>
699 operator>(const unique_ptr
<_Tp
, _Dp
>& __x
,
700 const unique_ptr
<_Up
, _Ep
>& __y
)
701 { return (__y
< __x
); }
703 template<typename _Tp
, typename _Dp
>
705 operator>(const unique_ptr
<_Tp
, _Dp
>& __x
, nullptr_t
)
706 { return std::less
<typename unique_ptr
<_Tp
, _Dp
>::pointer
>()(nullptr,
709 template<typename _Tp
, typename _Dp
>
711 operator>(nullptr_t
, const unique_ptr
<_Tp
, _Dp
>& __x
)
712 { return std::less
<typename unique_ptr
<_Tp
, _Dp
>::pointer
>()(__x
.get(),
715 template<typename _Tp
, typename _Dp
,
716 typename _Up
, typename _Ep
>
718 operator>=(const unique_ptr
<_Tp
, _Dp
>& __x
,
719 const unique_ptr
<_Up
, _Ep
>& __y
)
720 { return !(__x
< __y
); }
722 template<typename _Tp
, typename _Dp
>
724 operator>=(const unique_ptr
<_Tp
, _Dp
>& __x
, nullptr_t
)
725 { return !(__x
< nullptr); }
727 template<typename _Tp
, typename _Dp
>
729 operator>=(nullptr_t
, const unique_ptr
<_Tp
, _Dp
>& __x
)
730 { return !(nullptr < __x
); }
732 /// std::hash specialization for unique_ptr.
733 template<typename _Tp
, typename _Dp
>
734 struct hash
<unique_ptr
<_Tp
, _Dp
>>
735 : public __hash_base
<size_t, unique_ptr
<_Tp
, _Dp
>>
738 operator()(const unique_ptr
<_Tp
, _Dp
>& __u
) const noexcept
740 typedef unique_ptr
<_Tp
, _Dp
> _UP
;
741 return std::hash
<typename
_UP::pointer
>()(__u
.get());
745 #if __cplusplus > 201103L
746 template<typename _Tp
>
748 { typedef unique_ptr
<_Tp
> __single_object
; };
750 template<typename _Tp
>
751 struct _MakeUniq
<_Tp
[]>
752 { typedef unique_ptr
<_Tp
[]> __array
; };
754 template<typename _Tp
, size_t _Bound
>
755 struct _MakeUniq
<_Tp
[_Bound
]>
756 { struct __invalid_type
{ }; };
758 /// std::make_unique for single objects
759 template<typename _Tp
, typename
... _Args
>
760 inline typename _MakeUniq
<_Tp
>::__single_object
761 make_unique(_Args
&&... __args
)
762 { return unique_ptr
<_Tp
>(new _Tp(std::forward
<_Args
>(__args
)...)); }
764 /// std::make_unique for arrays of unknown bound
765 template<typename _Tp
>
766 inline typename _MakeUniq
<_Tp
>::__array
767 make_unique(size_t __num
)
768 { return unique_ptr
<_Tp
>(new typename remove_extent
<_Tp
>::type
[__num
]()); }
770 /// Disable std::make_unique for arrays of known bound
771 template<typename _Tp
, typename
... _Args
>
772 inline typename _MakeUniq
<_Tp
>::__invalid_type
773 make_unique(_Args
&&...) = delete;
776 // @} group pointer_abstractions
778 _GLIBCXX_END_NAMESPACE_VERSION
781 #endif /* _UNIQUE_PTR_H */