Comment by HolyBlackCat on Why does std::optional not have a specialization...
std::optional<T> constructs T only when it starts holding a non-empty object. It destroys its object when reset.
View ArticleComment by HolyBlackCat on Debugger underlines code that otherwise runs...
This is unrelated to the debugger, this is intellisense misbehaving. I recommend switching to Clangd, overall I find it to be a more reliable alternative to the stock C++ intellisense.
View ArticleComment by HolyBlackCat on Does the C++ Standard mandate the order of class...
Stateful templates (and complex macros) are the things that are easier to check on all popular compilers than analyze what the standard says about them.
View ArticleAnswer by HolyBlackCat for How does one escape backticks in markdown?
Addendum: At least on SO, when the code starts or ends with `, you need to add spaces inside of backticks on both sides.That is, if you want foo`, you must spell it as `` foo` ``, not as ``foo` ``,...
View ArticleComment by HolyBlackCat on I can`t run compile my c++ program in vs code can...
Don't just say "I followed this tutorial". If it doesn't work, most likely you did something wrong. Tell us what exactly you did, show the config files, etc.
View ArticleComment by HolyBlackCat on vscode debug C++
Show us a screenshot of the left bar, show launch.json and tasks.json if you have it, and tell us how you compile your program.
View ArticleComment by HolyBlackCat on How to build the C++ GLM library with cmake in...
GLM is header-only, I think? Then you don't need to build it.
View ArticleComment by HolyBlackCat on How to tell if my program needs libgcc_s.so.1?
Can't you ship libgcc unconditionally?
View ArticleComment by HolyBlackCat on Is there a way to have "partially recursive"...
Overloaded functions are unsuitable for this, because the earlier overloads don't see the later ones (except via ADL, which usually isn't good enough). Make a class template and specialize it instead....
View ArticleComment by HolyBlackCat on Why do std::vector v{1, 2, 3} and std::vector v =...
To be clear, how are you determining which constructor got called? By looking at the disassembly? The init_list ctor is likely calling the const int *, const int * one internally.
View ArticleComment by HolyBlackCat on Building wxwidgets with MinGW fails with file not...
I recommend installing prebuilt wxwidgets from msys2.
View ArticleComment by HolyBlackCat on collect2.exe: error: ld returned 116 exit status
Manually modifying PATH in the MSYS2 terminal is almost always wrong. Just use the correct shortcut (MSYS2 UCRT64 in your case) and it will add that directory to path for you, and more.
View ArticleComment by HolyBlackCat on How to tell if my program needs libgcc_s.so.1?
lld is already recursive out of the box.
View ArticleComment by HolyBlackCat on Why trie structure uses array, not map?
Print sizeof of your map. There's a good chance it alone is about the same size as your array.
View ArticleComment by HolyBlackCat on on writing aa cpp program , compilation is not...
Your executable is probably already running, close it first.
View ArticleComment by HolyBlackCat on 'iostream' file not found clang(pp_file_not_found)...
Clang on Windows is not self-sufficient, it has to be used either with Visual Studio or with MinGW. If you prefer the former, go install VS. If you prefer the latter, go reinstall Clang from MSYS2...
View ArticleComment by HolyBlackCat on How to pass macro to git submodule
If they use the macro only in the header, and don't call this function themselves, you can just define the macro in your own project (either in the project settings, or via #define).
View ArticleComment by HolyBlackCat on Could class reference members have in-class...
"as far as I know" And how to do you know this?
View ArticleComment by HolyBlackCat on Array Casting To Other Array
Obligatory "don't use the C tag for C++ questions".
View ArticleComment by HolyBlackCat on How to implement a child interface using...
@463035818_is_not_an_ai The question sounds like FooBar is a part of a library, while FooImpl and BarImpl are clients of that library, so FooFar can't inherit from them. I've amended it a bit.
View Article