boostorg / boostorg/smart_ptr

intrusive_ptr aliasing constructor?

Open
#93 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
111
Forks
116
PR merge metrics
No merged PRs in 30d

Description

Hi all,

I want to ask that is it reliable to implement `intrusive_ptr` aliasing constructor, similar to `shared_ptr` existing one?

Possible usage:
```
struct Test1 : boost::intrusive_ref_counter {
int a;
};

struct Test2 : boost::intrusive_ref_counter {
int b;
};

void fun(boost::intrusive_ptr ctr);

auto iptr1 = boost::intrusive_ptr(new Test1);
auto iptr2 = boost::intrusive_ptr(new Test2);

fun( {iptr1, &iptr1->a} );
fun( {iptr2, &iptr2->b} );
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.