Answer by HolyBlackCat for Different behavior when using the typetraits...
The concept only receives the auto part without &&, so int in your case.Note that since it's a forwarding reference, passing an lvalue would deduce the auto to T &, and that's what the...
View ArticleComment by HolyBlackCat on "cannot find -lSDL2_image" error when compiling a...
Regarding skipping incompatible - the files for SDL2 you've downloaded have two versions, x32 and x64. Try both. But I second the suggestion to use MSYS2.
View ArticleComment by HolyBlackCat on Clang forward slash in #include headers not...
You're probably mistaken, there has to be a QtCore directory somewhre with qglobal.h in it. I bet your compile_commands.json is missing some flags. Get qmake to show the compiler commands it's running...
View ArticleComment by HolyBlackCat on How is view-generation handled by absolute,...
Overall, newbies sometimes get this idea that learning the lowest possible level of abstraction is beneficial, but you have to draw the line somewhere, unless you want to write your own drivers, OS,...
View ArticleComment by HolyBlackCat on Bad alloc from variable shadowing?
I'd say its lifetime hasn't started yet. "Uninitialized" usually implies the lifetime has started.
View ArticleComment by HolyBlackCat on What's the behavior of an uninitialized variable...
@JanSchultke Not the best dupe, that one is about global variables.
View ArticleComment by HolyBlackCat on How to perform cross-platform testing for a C++...
If your CI doesn't test a certain compiler, you can't say you support it. IMO.
View ArticleComment by HolyBlackCat on Does overloading a function from another namespace...
@3CxEZiVlQ It is called inside A. It's the commented call inside A that fails, not the call inside main.
View ArticleComment by HolyBlackCat on How Do I Configure Visual Studio Code for C++ for...
This will likely get closed, we don't allow requests for tutorials. You can ask about the specific issues you have with VSC though.
View ArticleAnswer by HolyBlackCat for Detect a parenthesized macro argument in C
#define FOO(...) DETAIL_FOO1( DETAIL_FOO0 __VA_ARGS__ ) )#define DETAIL_FOO0(...) DETAIL_FOO0_ __VA_ARGS__#define DETAIL_FOO1(...) DETAIL_FOO2(__VA_ARGS__)#define DETAIL_FOO2(...)...
View ArticleComment by HolyBlackCat on std::begin(X) vs. X.begin() for rvalues
IMO both are wrong. It should be returning std::move_iterator or a similar type.
View ArticleComment by HolyBlackCat on Light chasing the player in SDL2
A simple answer is to make the texture larger, so that you can draw it off-center without exposing the opposite edge. A smarter answer is to create a lighting texture and render to it (fill with black,...
View ArticleComment by HolyBlackCat on GCC cross-compile - undefined reference errors
What platform will the code run on? As in, what hardware/OS does i386-pc-coff correspond to?
View ArticleComment by HolyBlackCat on Is there any advantage to moving a pointer?
This is initialization rather than assignment. And both are legal in an if.
View Article"Deducing this" causes `exception specification is not available until end of...
Consider the following code:struct A{ void foo(this auto &&) noexcept(true) {} auto bar() -> decltype(foo()) {}};Clang 19 rejects this code with the error below, while GCC and MSVC accept...
View ArticleComment by HolyBlackCat on Requires clause and friend injection
"Is it because the requires clause induce a change in the prototype, and then it does not overload exactly the same function ?" Yes.
View ArticleComment by HolyBlackCat on Pointer gives garbage values if using virtual...
Virtual (and multiple) inheritance causes the base to be at a non-zero offset in the derived class.
View ArticleComment by HolyBlackCat on Is it possible to replace the inbuild sort...
Yes, it's possible. What is your question, exactly? We're not going to do it for you, but we can help with specific issues you're having, if you explain what they are.
View ArticleComment by HolyBlackCat on Need help debugging 'cannot open source file...
Don't tell us that "I've configured X correctly", if you did everything correctly you wouldn't be there. Please add more information to the question: What OS? What compiler are you using, how did you...
View ArticleComment by HolyBlackCat on Emscripten Multiply defined symbol, vtable
This is simply illegal C++. At least one of the classes should be in unnamed namespace { ... } to not collide.
View Article