Comment by HolyBlackCat on Why do these operations violate data-race rule...
I think the spec is mildly defective in that it both says "semantics of volatile access is impl-defined", and at the same time has a bunch of rules describing said semantics. I assume the intent is to...
View ArticleComment by HolyBlackCat on Copyability conundrum for a class which is...
@einpoklum Nah, what I mean is that you mentioned the possibility of slicing, so one of the options you considered had to be inheritance but without CRTP, so I was curious how it would work.
View ArticleComment by HolyBlackCat on C++ gcc 15.2 compilation fail with template nested...
No error on GCC 16. Are you able to test the newer GCC?
View ArticleComment by HolyBlackCat on Issue linking and finding functions in C library
I hope understand that we can't help you with so little information. You just say that you did everything correctly, but you clearly didn't, or it wouldn't error. We need some code that we can run and...
View ArticleComment by HolyBlackCat on Will std::async run out of threads if a lot of...
@n.m.is-an-unemployed-ai-agent The spec says that std::async works "as if" in a separate thread (link). I believe this requires it to have separate thread_local variables, so e.g. a thread pool is...
View ArticleComment by HolyBlackCat on File pointer in C programming
What do you call "start of page"? Is the "page" the file you're reading?
View ArticleComment by HolyBlackCat on Should the noexcept spec for a move...
@einpoklum Still, I don't see it as a problem. The exception originates from outside the function. Any code that uses noexcept(expr) will have it return false. The only way you can get false positive...
View ArticleComment by HolyBlackCat on Are __SIZEOF_* preprocessor macros and others...
If you didn't find it in the spec, then it's not standard. Even if you're not on windows, you can check on godbolt/wine/vm what MSVC does (I just checked, it doesn't define them).
View ArticleComment by HolyBlackCat on How to fill gaps at line joints when rendering...
"how to implement them in my current triangle-based setup where each line is generated independently" You can't generate them independently if you want those joints. Each line needs to know about the...
View ArticleAnswer by HolyBlackCat for What's the rationale for std::current_exception(),...
Firstly, std::current_exception() allows type erasure. Let's say you want to pass the exception to some function that handles it. What parameter type should the function have? std::exception &?...
View ArticleComment by HolyBlackCat on How placement new creates multiple objects within...
@Dmitriano That's definitely the intent, as you can see from eel.is/c++draft/expr#basic.lval-11.3 . But turns out that section alone is not enough to make it work, hence those defects.
View ArticleComment by HolyBlackCat on How placement new creates multiple objects within...
@Someprogrammerdude Do you have a source for non-overlapping storage reuse destroying the old object?
View ArticleComment by HolyBlackCat on Why are "tiny" types like std::float8_t and...
@mkrieger1 I agree this shouldn't be tagged advice, but removing the tag invalidates some answers, so I've pinged the person who posted them.
View ArticleComment by HolyBlackCat on How to pass a constant array literal to a function...
@Hibou57 The second form is called a "compound literal" and is a C-only feature. Compilers are correct to complain about it in C++. The first form can be valid in C++, but it depends on the parameter...
View ArticleComment by HolyBlackCat on If A *happens-before* B in an execution, could...
I don't understand why you're asking this. You tagged this LL, but you yourself said that the spec doesn't define what wall clock time is, so anything is possible. And if you remove LL, the answer is...
View ArticleComment by HolyBlackCat on I need help choosing file dialog library for C++...
Unless you're locked into a specific ImGui backend, how about SDL? It both has file dialogs and can be used as a backend.
View ArticleComment by HolyBlackCat on Error when passing references to std::thread
While this is not what you asked, if your reason for using a thread is to have the NPC "think" in paralle with the gamel, then you probably shouldn't use threads. Instead you should break the NPC...
View ArticleComment by HolyBlackCat on What do these errors mean
While this is not what you asked, if your reason for using a thread is to have the NPC "think" in paralle with the gamel, then you probably shouldn't use threads. Instead you should break the NPC...
View ArticleComment by HolyBlackCat on Compiler complaining about non-copy-assignable...
Eh, do we need a self-answered Q&A for this? It's basically just a forgotten if constexpr (plus maybe not knowing what triviality means on an assignment). I think each of the two should have dupe...
View ArticleComment by HolyBlackCat on Compiler complaining about non-copy-assignable...
I don't think it's really a bug. You just shouldn't have always-false ifs.
View Article