Anonymous
Have you never spent 2 hours fiddling with the wrong function overload in search of a dumb bug or gotten hit on the head when implementing a function with the same name as another in a different namespace?
😂 I have faced more issues with concurrency and Undefined Behavior but not that many with overloading. Btw this is a problem that happens in D as well. UFCS is not meant to help with that. The problem you desctibe is because of the developer overloading on similar stuff which will always be a pain in the ass. My point is that implementing UFCS is not a problem as far as compiler writers are concerned.
mayway
How is abdul bari sir c++ course??
Anonymous
Have you never spent 2 hours fiddling with the wrong function overload in search of a dumb bug or gotten hit on the head when implementing a function with the same name as another in a different namespace?
If you use arguments from two different namespaces in a function call, then the onus is on you to check the namespaces to see if that function exists in either of the namespaces. Easier said than done, I know.
Anonymous
Well, i will just say that i hate std::swap when i an using my freestanding library in a non freestanding environment
Well, it is most likely that your swap is a non template function. So in this case a call to swap will always resolve to your swap as long as one is found. I just do this always : using std::swap; swap(arg1, arg2);
Anonymous
No, the problem is that both are
Oh well then it is a problem.
Ludovic 'Archivist'
So they cannot both exist
Ludovic 'Archivist'
Oh well then it is a problem.
Yes, and no amount of conditional concepts seem to solve that except the dirtiest ones
Ludovic 'Archivist'
Aka concept no_freestanding = same_as<void, int>
Ludovic 'Archivist'
Bottom line is, give me static reflection, i want to see is std::swap is something that exists
Ludovic 'Archivist'
😭
Anonymous
Blackout here. Damn it!!! Just when I was typing a long message on reflexpr on my system.
Ludovic 'Archivist'
I don't
hi. mb u know about uintptr_t?
Mikael
hi. mb u know about uintptr_t?
https://stackoverflow.com/questions/1845482/what-is-uintptr-t-data-type
Anonymous
When you have already posted the Stack Overflow link, there is no reason to copy/paste the answer from there again. It just floods the group.
Ludovic 'Archivist'
Also, anything said on Moron Overflow requires further scrutiny
Ludovic 'Archivist'
Particularly given that only a third of the community may actually be able to read
Anonymous
Particularly given that only a third of the community may actually be able to read
I prefer Reddit to Stack. Stack Overflow is good for language lawyer questions. But otherwise it is just a place for bullies.
Ludovic 'Archivist'
I prefer Reddit to Stack. Stack Overflow is good for language lawyer questions. But otherwise it is just a place for bullies.
One day i asked "what registers must be preserved when context switching between stackful coroutines on x86" and that got buried and labelled as too broad
Ludovic 'Archivist'
I think that was the narrowest question i had ever seen on SO
Anonymous
One day i asked "what registers must be preserved when context switching between stackful coroutines on x86" and that got buried and labelled as too broad
I was negatively rated for asking about a general design use case based question on noexcept specification and the reason behind why there was a difference between throw and noexcept in C++14. The question was marked as not a good fit because it was opinion based. There was this person Nic Bolas who got his minions to rate the question negatively. Got around 200 negative votes for it. That was the day I quit SO. I still can't understand why asking about a design decision in the standard is an opinion based question.
Anonymous
I quit SO like 3 days after joining. Community is mostly useless and favours terrible advice, provides code that mostly doesn't work and of all the stackexchange landscape is about the worst
Try reddit C++ community. They are a very friendly group and the code review community there is good too. But in general if you want your code to be reviewed, it is better to do it in your local C++ communities. I am not sure if you have one in your country but we have quite a few in my place.
Ludovic 'Archivist'
Like Total's geology team and other chemical engineers
Ludovic 'Archivist'
I also don't publish anything in French online so i am not really known as a part of the local community
Ludovic 'Archivist'
Like Total's geology team and other chemical engineers
(maybe they will think i am one of them because i speak their languages of rocks and carbon though)
Anonymous
I am not very implied with my local C++ community, the community is almost non existent and mostly composed of the local scientifically implied companies laboratories
I am not talking about the standard committee chapters. We have local C++ communities (organized on Meetup and Trev) around our areas. We meet once in a fortnight or a month and discuss new topics. Everyone is encouraged to participate. Sometimes they invite an eminent person (Stephan Lavavej was the last guy who came 2 months back and spoke on Monads in C++). You tend to learn a lot.
Anonymous
I also don't publish anything in French online so i am not really known as a part of the local community
Aah alright. I am yet to read your 2nd part on concurrency. Liked the first part (did feel that there are some places where you could have gotten away with memory_order_relaxed when you instead chose the stricter acquire/release)
Ludovic 'Archivist'
And on what the runtime/kernel implements them
Anonymous
The second part is about waiting mutexes (which is also what condition variables are, kind of)
I saw that you had posted the link. Haven't yet checked it out but. Have it in the reading list.
Ludovic 'Archivist'
Still working on part 3 which may involve an actual kernel (no guarantees) and real multithreading from ∅
Ludovic 'Archivist'
It will be that or lock free datastructures which is still on the table
Anonymous
It will be that or lock free datastructures which is still on the table
Try wait free data structures if possible. That would be an even more challenging exercise
Ludovic 'Archivist'
Try wait free data structures if possible. That would be an even more challenging exercise
Better see the lockfree ones first since they are far simpler
Ludovic 'Archivist'
And also you can make near waitfree lockfree datastructures with clever multiplexing
Ludovic 'Archivist'
(abandonning linearization though)
Anonymous
Better see the lockfree ones first since they are far simpler
I implemented a wait free queue a long time back. Lost interest in them afterwards given how painful it was.
Anonymous
I implemented a wait free queue a long time back. Lost interest in them afterwards given how painful it was.
This was the paper I based it on http://par.univie.ac.at/project/peppher/publications/Published/opodis10lfq.pdf
olli
One day i asked "what registers must be preserved when context switching between stackful coroutines on x86" and that got buried and labelled as too broad
Does this question still exist? If this is all the context you gave it does indeed feel broad. The reason I like SO is because in my experience the quality of the answers seems to be correlated to the quality of the question. I never had any issue.
Ammar
I quit SO like 3 days after joining. Community is mostly useless and favours terrible advice, provides code that mostly doesn't work and of all the stackexchange landscape is about the worst
NAK! I like SO and I think SO is very useful community. I can easily find high-quaily QnA on there. I have been a SO member for 5 years and never had your problem at all. My experience in interacting with x86 topic, which I think the answer on this specific topic is often good and detail says the opposite with your experience.
Ammar
Lookie here, this is my newest question on x86-64 topic. Got very nice response and resolution. https://stackoverflow.com/questions/69515893/when-does-linux-x86-64-syscall-clobber-r8-r9-and-r10
Anonymous
Does this question still exist? If this is all the context you gave it does indeed feel broad. The reason I like SO is because in my experience the quality of the answers seems to be correlated to the quality of the question. I never had any issue.
Well questions on the language (features, usage and stuff) usually do get awesome answers like I said earlier. I refer to Stack Overflow myself when I need some quick answers. But there is a very fine line between a language construct and scenarios in which to use them. When your question borders on use cases, you most often end up getting the question closed as being opinion based. This is not a problem on Reddit. And Reddit being a discussion forum rather than a question/answer forum opens up so many interesting opinions and you tend to gain more than what you expected. Most of the developer's problem are not just with a language construct but often require guidance. SO is a nasty place when you need guidance
Ammar
> SO is a nasty place when you need guidance This is not true, each SE branch has its own tour and specific topic. For SO we have this https://stackoverflow.com/tour Bad response from the community mostly happens because the poster doesn't follow the SO guidelines.
Anonymous
> SO is a nasty place when you need guidance This is not true, each SE branch has its own tour and specific topic. For SO we have this https://stackoverflow.com/tour Bad response from the community mostly happens because the poster doesn't follow the SO guidelines.
I was a SO user for close to 6 years and was in the top 1%. I am familiar with the rules there But being downvoted for asking about the reasons behind a design decision by another user (Nic Bolas was the one who wrote the proposal for it) in the standard is not the way to go.
Anonymous
> SO is a nasty place when you need guidance This is not true, each SE branch has its own tour and specific topic. For SO we have this https://stackoverflow.com/tour Bad response from the community mostly happens because the poster doesn't follow the SO guidelines.
And I am not sure if you have explored other places in SE like Meta, Code Review and stuff. If not please go and check the discussions that happen there and tell me if you are happy with the discussions there. The problem is that SO wants to be a one stop place for technical problems and yet brackets itself to a narrow vision of what constitutes technical questions with no outlet for people whose questions don't fit their exact definition of a Q and A
olli
And I am not sure if you have explored other places in SE like Meta, Code Review and stuff. If not please go and check the discussions that happen there and tell me if you are happy with the discussions there. The problem is that SO wants to be a one stop place for technical problems and yet brackets itself to a narrow vision of what constitutes technical questions with no outlet for people whose questions don't fit their exact definition of a Q and A
Haven't really used meta but have used code review and have not had any bad experiences. I just browsed through it and opened a random topic, this looks nice, helpful and to the point. https://codereview.stackexchange.com/questions/269914/writing-a-c-matrix-class I can't remember seeing unjustified downvotes on either SO or CR And the software design questions I saw had good answers over at the software engineering stack exchange.
Ludovic 'Archivist'
Does this question still exist? If this is all the context you gave it does indeed feel broad. The reason I like SO is because in my experience the quality of the answers seems to be correlated to the quality of the question. I never had any issue.
What? I gave the arch, and the usecase, the answer is not broad, it is extremely specific: ebx, esp and ebp are the only ones you need to save The question was locked years ago
Ludovic 'Archivist'
x86_64 has r12 through r15, rbx, rbp and rsp
olli
What? I gave the arch, and the usecase, the answer is not broad, it is extremely specific: ebx, esp and ebp are the only ones you need to save The question was locked years ago
I would argue it depends on your calling convention and ABI. For a general purpose stackful coroutine these three registers might not be enough
Ludovic 'Archivist'
I would argue it depends on your calling convention and ABI. For a general purpose stackful coroutine these three registers might not be enough
You can ignore that complication quite easily by calling for that save in a function since anything mandated to be saved by the calling convention will be saved on function call
olli
You can ignore that complication quite easily by calling for that save in a function since anything mandated to be saved by the calling convention will be saved on function call
true, but based on your question I am not aware which calling convention you are using and hence can't enumerate the registers you need to worry about my whole point was: Imho a question is not good if one needs to ask something to answer it
Ludovic 'Archivist'
Implying it is a necessity to save them for the desired result, not advisory
Ludovic 'Archivist'
When i wrote that question i meant every single word of it, not 95% of the words i used
Ludovic 'Archivist'
what exactly is an excuse?
Saying that the question is unclear
Ludovic 'Archivist'
I had to fish that list in the x86 standard btw, as it is entirely unrelated to calling conventions
Ammar
x86_64 has r12 through r15, rbx, rbp and rsp
This sounds like System V ABI, it indeed mandates those registers must be preserved across function calls. What is actually the x86 standard you mean?
Anonymous
could imgui install by apt-get
Anonymous
could imgui install by apt-get
apt-get could install anything
Anonymous
Check if your repo has it
Anonymous
when using cmakelist
Anonymous
I need to add all .cpp file to add_execuable
Anonymous
could I do something to add it automotically
Anonymous
scan a file and set name for every file named with .cpp and .c
Anonymous
Like this: file(GLOB SOURCE_FILES src/*.cpp)
Anonymous
And then use the SOURCE_FILES variable or whatever u called it
Anonymous
I remember a expressiong aux
Anonymous
what can that do ?