Похожие чаты

How to call a private constructor out of class? Some time

ago i read an article about "How to call a private constructor out side of class?", which explained a way to do that. But right now, i couldn't find it. did anyone know anything about it?

10 ответов

24 просмотра
Ghasem-Ramezani Автор вопроса

http://bloglitb.blogspot.com/2010/07/access-to-private-members-thats-easy.html

why do you "need" to call/invoke a private constructor ? 🤔

Ghasem-Ramezani Автор вопроса
Mihai
why do you "need" to call/invoke a private constru...

I don't need that in the production or any other projects. That is just fun for me.

Ghasem-Ramezani Автор вопроса
Ghasem Ramezani
http://bloglitb.blogspot.com/2010/07/access-to-pri...

How to access private member variables(yeah i know that could be UB, but it is fun): class A { int value; }; class B : A {}; B b; *((int*)(A*)&b) = 10;

You don't even need B for that something like this will be the same (and this is UB) A a; *((int*)&a) = 10;

Ghasem-Ramezani Автор вопроса

I need it to show how you could even touch the vtable

Ghasem Ramezani
I need it to show how you could even touch the vta...

There's no vtable in this case, since no virtual functions

Thomas
What makes it UB?

Hmmm, after you mentioned it I don't see why, however I'm not sure if its not

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

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

Господа, а что сейчас вообще с рынком труда на делфи происходит? Какова ситуация?
Rꙮman Yankꙮvsky
29
А вообще, что может смущать в самой Julia - бы сказал, что нет единого стандартного подхода по многим моментам, поэтому многое выглядит как "хаки" и произвол. Короче говоря, с...
Viktor G.
2
@Benzenoid can you tell me the easiest, and safest way to bu.y HEX now?
Živa Žena
20
This is a question from my wife who make a fortune with memes 😂😂 About the Migration and Tokens: 1. How will the old tokens be migrated to the new $LGCYX network? What is th...
🍿 °anton°
2
30500 за редактор? )
Владимир
47
а через ESC-код ?
Alexey Kulakov
29
What is the Dex situation? Agora team started with the Pnetwork for their dex which helped them both with integration. It’s completed but as you can see from the Pnetwork ann...
Ben
1
Гайс, вопрос для разносторонее развитых: читаю стрим с юарта, нада выделять с него фреймы с определенной структурой, если ли чо готовое, или долбаться с ринг буффером? нада у...
Vitaly
9
Anyone knows where there are some instructions or discort about failed bridge transactions ?
Jochem
21
@lozuk how do I get my phex copies of my ehex from a atomic wallet, to move to my rabby?
Justfrontin 👀
11
Карта сайта