Anonymous
If you don't know what a vector is and how to use it and what to use it for — it's not my problem, it's yours
Anonymous
Anonymous
⚛ Hz
(you can literally put RAII resources into vector.. but why "another process"?
Anonymous
Anonymous
So it's banch of memory, isn't it?
Anonymous
Anonymous
Anonymous
You have no clue how C++ memory model works
Anonymous
Anonymous
Seems more than you :)
Anonymous
If you think that a vector is just a bunch of memory
⚛ Hz
If you want to use stl container as buffer, maybe string is a better choice, at least it has defined behavior for .data()
⚛ Hz
(but &vec[0] for standard layout element should also be defined)
Box of
Anonymous
Now I'm tired
After your statement about bunch of memory I totally don't want waste time arguing with you
Anonymous
Good night
Anonymous
Be a good boy, @dkuch_us
Anonymous
my statement is correct (vector is a continuous peace of memory)
Anonymous
It is not correct
Anonymous
Ok, continues peace of memory plus O(1) additional info
Anonymous
Still not correct
Anonymous
Vector is a contiguous container of objects
Anonymous
It's not about memory
Anonymous
Everything in C++ is an object (except references and functions)
Sandro
It could but not.... You can represent or as a contiguous byte of memory, but physically can be discontinuous...
Anonymous
Even this was UB until C++20
int* a = (int*)malloc(sizeof(int));
*a = 5;
Anonymous
Anonymous
I don't know, I want to sleep. bye
Anonymous
But if you want to share resources between processes use tools that were DESIGNED for that
Anonymous
Vector is not designed to be shared
⚛ Hz
Wait, it is about sharing memory across process, I probably know where the dispute is
Anonymous
C++ doesn't even have a definition of process
Anonymous
There is no such a term in c++ as a process
Anonymous
Anonymous
https://t.me/programminginc/365448
Anonymous
I gave an example
Anonymous
In Linux or Windows or any sane OS it exists
Anonymous
Your example is not correct, because you used a vector for a case it's not designed for
Do you understand it?
⚛ Hz
(but in theory, you could build a *shared memory allocator* for that purpose
Anonymous
Anonymous
And what does it prove?
Anonymous
Signals are another example of IPC
Anonymous
So, technically some sort of external effects exist in c++
Anonymous
Anonymous
Anonymous
⚛ Hz
https://eel.is/c++draft/support.signal
Igor🇺🇦
It's in standard C++
Yeah, I mean it's only handler. It's not like you can send a signal or something and have async flow. I was thinking more like https://theboostcpplibraries.com/boost.signals2-signals
Or https://doc.qt.io/qt-5/signalsandslots.html
Anonymous
Igor🇺🇦
Async/await exist in c++ 20
Yes, co-routines and signal/slot are not the same. With proper signals/slot you can easily create asynchronous observer pattern. Co-routines is something different.
Akshay
Any idea about project in C
MRT
The variable defined by &, means variable is reference
So what does this mean?
const int& x = 50;
We defined the reference variable with a number. What is this variable referring to now?a
Hanz
MRT
50 🤷♂
Now I understand that this is only for the const
Hanz
Hanz
MRT
One can give an example of this book sentence with a code (It is important to remember that there
is no guarantee that an object pointed to by a pointer to const won’t change.)
Prince Of Persia
is C-- is a good language?
Prince Of Persia
I'm not joking!
Hanz
Prince Of Persia
Prince Of Persia