File tree Expand file tree Collapse file tree 1 file changed +19
-1
lines changed Expand file tree Collapse file tree 1 file changed +19
-1
lines changed Original file line number Diff line number Diff line change 33
44namespace LV
55{
6+ namespace Impl
7+ {
8+ // Checks that the required overloads for LV::IntrusivePtr<> are met.
9+ // NOTE: Only used for concept checking.
10+ template <typename T>
11+ void check_intrusive_ref_countable (T* a)
12+ {
13+ intrusive_ptr_add_ref (a);
14+ intrusive_ptr_release (a);
15+ }
16+ }
17+
18+ // ! Concept for reference countable types that can be used with LV::IntrusivePtr.
19+ template <typename T>
20+ concept IntrusiveRefCountable = requires (T* a)
21+ {
22+ Impl::check_intrusive_ref_countable (a);
23+ };
624
725 // ! Intrusive smart pointer class template.
826 // !
@@ -15,7 +33,7 @@ namespace LV
1533 // ! * void intrusive_ptr_add_ref(T* object) -- _Called to add a reference_
1634 // ! * void intrusive_ptr_release(T* object) -- _Called to remove a reference and destroy the object when not longer used_
1735 // !
18- template <typename T>
36+ template <IntrusiveRefCountable T>
1937 class IntrusivePtr
2038 {
2139 public:
You can’t perform that action at this time.
0 commit comments