Comment by HolyBlackCat on Initializing multiple pointers with same value...
We already have an answer from 2017 suggesting the same thing.
View ArticleComment by HolyBlackCat on How can I enforce that a class passed to a...
I would use std::sort for everything. As for automatically testing the classes, this most probably isn't possible (without some sort of a static analyzer; maybe clang-tidy has something?).
View ArticleComment by HolyBlackCat on Why does the right shift operator give unexpected...
Since it's called "bitshift", look at the binary representations of the numbers before and after the shift.
View ArticleAnswer by HolyBlackCat for Is this understanding correct: If an object stores...
At least in C++, this is usually true for classes without design mistakes. But since you can have arbitrary code in copy/move constructors/assignments, it can't be true for arbitrary classes.One...
View ArticleComment by HolyBlackCat on how to get rid of red lines in zed?
You need to tell us what zed uses for code completion (which is most likely Clangd). And if it is Clangd, read its manual to know how to configure it: clangd.llvm.org
View ArticleComment by HolyBlackCat on Cant figure out i = i++
@Nifriz This could be what OP's compiler is doing, but in general this is UB.
View ArticleComment by HolyBlackCat on how to get rid of red lines in zed?
As I already commented in the staging ground, you need to tell us what zed uses for code completion (which is most likely Clangd). And if it is Clangd, read its manual to know how to configure it:...
View ArticleComment by HolyBlackCat on Terminal in Visual Studio Code is not working
What does "not working" mean? Did you enable the terminal in the View menu?
View ArticleAnswer by HolyBlackCat for Creating a "view" of a sibling class avoiding...
A (somewhat cumbersome) solution is to give as_curvilinear_shape the following signature:const CurvilinearShape &as_curvilinear_shape(CurvilinearShape &storage) const;If it's already the right...
View ArticleComment by HolyBlackCat on Window seems to be created twice
What desktop environment? Maybe it's something DE-specific? And what OS? (What version of Debian?)
View ArticleComment by HolyBlackCat on VSC does not recognize data types even if it found...
You probably need to set "compilerPath" properly. This toolchain has its own GCC, right?
View ArticleComment by HolyBlackCat on Is synchronization relationship necessary to avoid...
No memory_order would prevent this code from calling need_close() more than once. Also I suggest replacing rand() with something else (something thread-safe), if your question is not specifically about...
View ArticleComment by HolyBlackCat on How do I use Clang's attribute `preferred_name`?
@MarekR Well yes, as I said "Defining this class and declaring a variable of [this] type ... also fixes it." But this isn't viable for arbitrary classes (requires definition, requires the constructor...
View ArticleComment by HolyBlackCat on Window seems to be created twice
You should report it as a bug to SDL devs.
View ArticleComment by HolyBlackCat on Is there a way to customize the behaviour of code...
This extension lets you specify folding rules using regex, but I don't think it lets you do summaries.
View ArticleHow do I use Clang's attribute `preferred_name`?
Clang has a non-standard attribute preferred_name that is used e.g. in libc++ to spell std::basic_string<char> as std::string (which is more user-friendly).I'm trying to use it for my own types,...
View ArticleComment by HolyBlackCat on Mingw Compiler file download issue
Can you add the link, from where are you trying to download it? There are several different versions, some better than others.
View ArticleComment by HolyBlackCat on UCRT vs. MSVCRT for GCC 14.x
FYI, MSYS2 has prebuilt wxWidgets (and many other libraries) for both UCRT and MSVCRT. (And GCCs for both.)
View ArticleAnswer by HolyBlackCat for Why does C++ choose the base class overload when...
Simply because Derived doesn't declare its own foo, but rather inherits it from Base. If you override (or shadow) it, the type will change to ... (Derived::*)(...).This is sometimes useful in templates...
View ArticleComment by HolyBlackCat on how do i create a folder to save all the objects...
Show the contents of your makefile. Please format it as code, and same for the error messages.
View Article