Похожие чаты

How do I create a void* but as shared_ptr?

17 ответов

9 просмотров

You mean something like std::shared_ptr<void>? Theoretically you can use it, use std::static_pointer_cast to use it as a pointer to a specific type and create shared pointers with a custom deleter, where you decide how you want to delete the data

Nils
thx

Found some article about it https://www.nextptr.com/tutorial/ta1227747841/the-stdshared_ptrvoid-as-arbitrary-userdata-pointer

Nils- Автор вопроса
Pavel
Found some article about it https://www.nextptr.co...

this->src = std::static_pointer_cast<void>(std::make_shared<dppsrc>); Like this?

Nils- Автор вопроса
Nils
sorry?

It's another bot

What's wrong with std::shared_ptr<void>?

Nils- Автор вопроса
Nils
it can't be static_casted

What do you want to cast it to?

Nils- Автор вопроса
Nils
shared_ptr<some class>

Some class is not void

Ihor
Some class is not void

are you even reading the conversation?

bumbread.rs
are you even reading the conversation?

What exactly do I need to read? 🤔

Nils
it can't be static_casted

you don't need to cast it though...

Похожие вопросы

Обсуждают сегодня

Hi everyone! I have a two-folded message to share today. First: updates and news, as we are being asked for those. We still want to go like we did the last 6 years: we w...
Marten | Unibright.io
31
комрады, че-та лыжы не едут var tmpFont: TFont; begin tmpFont:= TFont.Create; try case rgFontColor.ItemIndex of 0: tmpFont.Color:= clWindowText; 1: tmpFo...
Ed Doc
34
VIP-310 Set RedStone as the MAIN oracle for BTC and BNB on BNB Chain Summary If passed, this VIP will perform the following actions: - Configure RedStone as the MAIN oracle...
Venus Announcements
1
Интересно, нет ли какого-то способа получить из dll не адрес самой метки, а адрес со смещением?
The Bird of Hermes
54
monero is the only tool for privacy and currency . why would we destroy it?
😎
13
🔍 Launch of Sentinel dVPN's Native Explorer 🎉 The Sentinel Growth DAO is thrilled to announce the launch of Sentinel dVPN's new native blockchain explorer! Now anyone can div...
Joey | BadgerBite Joeyy
1
Можно вообще написать: Person fName' lName' age'. Тогда действительно имена полей потребуются лишь в строковом виде, чтобы эти fName' и т.д. достать :-) Но разве для этого нуж...
Михаил
8
Its been almost a week and the upgrade only went from 30% to 35%, why so slow?
Jackson
10
generic procedure function test<T>(param: T); type case T of longint: NewT = word; longword: NewT = byte; end; var v1: NewT; Как это можно сделать? Чтобы у меня...
notme
21
Whoa, did you guys see this FUNToken Seed Grant announcement? 💸
Noah Noure
37
Карта сайта