Rose
That's 2/2 warnings; Fan of is banned! Reasons: 1: ad 2: ad
Vlad
Can you send a example cause I'm not getting this.
How would you implement std::vector In C? If you want it to work with all types? You either put void* as an element type and force the user to allocate it somewhere, a union, or you specify size of an element in the constructor. All the while the user have to properly cast it to his type himself to use it
Vlad
The result that is fragile and error prone
Vlad
You don't have to implement std::vector somewhat by the existence of realloc, but for some more complex containers it's still an issue
B
And a set of functions that do resize, fit to actual data size, add, remove, shift and etc on the array?
Vlad
Header containing data about the array and a continues block of memory after it?
This would work for the vector analogue, not so much for std::map for example
B
And a set of functions that do resize, fit to actual data size, add, remove, shift and etc on the array?
You can even make a header that is detached form the memory block, not as performant but has some other nice benefits .
Vlad
And you still have to cast the pointer to whatever type you actually have
B
You can even make a header that is detached form the memory block, not as performant but has some other nice benefits .
Then you can have different allocation factors, make the functions generic, and you'll end up with a lib that I'm working on .
B
This would work for the vector analogue, not so much for std::map for example
glib has a assoc array interface, IDK how they do it, but it is one of the more widely used .
B
https://troydhanson.github.io/uthash/index.html
B
Another one .
B
Hash tables are one of those things that have a high potential for optimization when tuned to your data and use case .
Ludovic 'Archivist'
And a set of functions that do resize, fit to actual data size, add, remove, shift and etc on the array?
So slower than C++ since you need to calculate part of sizing at runtime, exactly Vlad's point
Vlad
So slower than C++ since you need to calculate part of sizing at runtime, exactly Vlad's point
Also compiler optimizations can't be as easily applied because type information is not as available
B
Also compiler optimizations can't be as easily applied because type information is not as available
It is, each of the above mentioned functions are called with the sizeof the type they shall work on as their last arg . The type sizes are not stored in the data header . The data header has a byte of flags, the length and allocated length .
Vlad
But about type information, which might aid compiler for simd, or to reduce some parts of the code entirely
Jenna 🖤
Please only C++?
Vlad
Please only C++?
What did they offer you?
Unknown
Give a book which is best for python
Dot
Give a book which is best for python
Beginner : Head First Python Advanced : Fluent Python
A
Who can help with c++
A
How to connect the c++ compiler to VS code please help
Ivan
Sounds like a self-advertisement 🤨
Sbhe
Hello, does anyone have any resource recommendations for Windows on socket programming in C++?
Vlad
jk
Vlad
man 2 socket
Vlad
There are bsd sockets ports on binbows
Vlad
That will do hideous winapi stuff for you
Ivan
Cygwin or mingw i would say may help you
Vlad
Yeah but sometimes you should try to run before you can fly if you catch my drift
THE_DARK_KNIGHT
Okay
Rehema
Australia here ?
klimi
Australia here ?
This is c/c++ programming group, not Australia.
Ivan
This is c/c++ programming group, not Australia.
Average day on the C++ tg group be like:
Vlad
This is c/c++ programming group, not Australia.
Just change sign of the group's .Y value and it'll be australia, mate
Ivan
Just change sign of the group's .Y value and it'll be australia, mate
I am afraid of arachnids 😭😭😭 Some of them have pluses on their tummy though 🤔🤔🤔
Vlad
I am afraid of arachnids 😭😭😭 Some of them have pluses on their tummy though 🤔🤔🤔
that's a toiny spidah, mate, no worries, them fangs aint poisonous
Ivan
That's because you don't eat enough spiders
Is this how you became proficient in C++? In this case I kinda consider switching back to rust. Eating crabs is much more pleasant, you know XD
Ivan
On rust you eat rust
Oh yeah, leaking rusty nails, mmmm ☺️
Ivan
that's a toiny spidah, mate, no worries, them fangs aint poisonous
Never knew one may not only speak but write Aussie too
Ludovic 'Archivist'
Never knew one may not only speak but write Aussie too
Al'ight mate t's time to lie on the lawn and hit the goon bag
Ivan
Al'ight mate t's time to lie on the lawn and hit the goon bag
Is it the same as a goon cave but a portable version or something? Nah, brainrot slang went too far 😭
Vlad
Al'ight mate t's time to lie on the lawn and hit the goon bag
Very kind of you to propose the fellow mate with some quality time on his lawn with a glass of wine
Ludovic 'Archivist'
Anonymous
Hello every one
Ludovic 'Archivist'
K, right from the box it is
Come on, you are a savage, take the shinies outta the box, God needs to see his reflection on em
Ludovic 'Archivist'
I have completely lost the conversation thread 0_o
Ya need to learn of Goons of Fortune mate
Vlad
Hello every one
Hello Loran, please enquiry your C++/Australia question
Ivan
Hello Loran, please enquiry your C++/Australia question
I am crying out loud, this is hilarious
Anonymous
Hello Loran, please enquiry your C++/Australia question
"Hi, thank you for your message! Can you please remind me of your exact question regarding C++ and Australia? I’d be happy to help and provide the information you need."
Anonymous
Excuse me i'm sorry
Ivan
Excuse me i'm sorry
It is not, it does its thing sometimes, don't you worry
Ivan
Excuse me i'm sorry
It has kinda too many false positives for my liking
Ivan
That was not a false positive .
Okay then, good for us
B
I'm realy sorry
OK read the rules next time .
Anonymous
Vlad
No brother
You shall be forgiven once you post C++ related question
Ivan
You shall be forgiven once you post C++ related question
This chat gets more and more funny with each day
Never Spam Bot
Mikhail Konyukhov is now approved by the group admin and can send messages without any restrictions Hi! Somebody can help me? The function int mprotect(const void *addr, size_t len, int prot); requires to *addr aligned to memory page (4096) or not? See spam? Quote the spam message in the group and reply with /spam
Mikhail
Hi! Somebody can help me? The function int mprotect(const void *addr, size_t len, int prot); requires to *addr aligned to memory page (4096) or not?
Rose
User Dark has 1/2 warnings; be careful! Reason: yt ad
DaviChan
what are you guys working on btw. both professionally and for personal projects. Would be interesting to know