Skip to content

Add an intrusive pointer implementation#2

Merged
BurningEnlightenment merged 1 commit intomasterfrom
dev/1-add-an-intrusive-smart-pointer-type
Jun 7, 2022
Merged

Add an intrusive pointer implementation#2
BurningEnlightenment merged 1 commit intomasterfrom
dev/1-add-an-intrusive-smart-pointer-type

Conversation

@BurningEnlightenment
Copy link
Copy Markdown
Contributor

Implement a smart pointer for reference counted objects.
Support aliasing the reference counted object with an unrelated object.
Support adapting foreign reference counting APIs.

Add a customization point for reference counted types which can be used
to adapt foreign reference counting APIs.

Solution Sketch

Add a template<typename T, ref_counted RC> class intrusive_ptr which
is specialized for the T == RC case to act like the usual intrusive pointer
and otherwise like an aliasing pointer. template<> class intrusive_pointer<void, void>
is a type erased handle.


Checklist

  • Tested on x64-linux-clang-debug
  • Tested on x64-linux-gcc-debug
  • Tested on x64-windows-clang-debug
  • Tested on x64-windows-msvc-debug
  • Tested on x64-windows-msvc-lto
  • clang-format is happy

Resolves #1

Implement a smart pointer for reference counted objects. Support
aliasing the reference counted object with an unrelated object.

Add a customization point for reference counted types which can be used
to adapt foreign reference counting APIs.
@BurningEnlightenment BurningEnlightenment self-assigned this Jun 7, 2022
@BurningEnlightenment BurningEnlightenment merged commit 1f4079b into master Jun 7, 2022
@BurningEnlightenment BurningEnlightenment deleted the dev/1-add-an-intrusive-smart-pointer-type branch June 7, 2022 14:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add an intrusive smart pointer type

1 participant