Comment by HolyBlackCat on Confusion about the UCRT, libc++, and Windows...
UCRT (ucrtbase.dll) is the (new) Microsoft's C runtime. Depending on it is normal (though it's possible to get a version of MinGW that instead depends on the older msvcrt.dll, but I don't see why you'd...
View ArticleComment by HolyBlackCat on Confusion about the UCRT, libc++, and Windows...
The last two paragraphs seem to be wrong? Clang can use the same C and/or C++ standard library as either GCC and MSVC, you can freely mix it with one of the two.
View ArticleComment by HolyBlackCat on Perfect forwarding and non-type template parameters
@wohlstad Pointer and reference template parameters can only point to global/static variables. When I tested it, I didn't wrap this code in int main() {...}, while you did.
View ArticleComment by HolyBlackCat on LLDB debugging doesn't work with std::cin
So what happens when you try to type something in that blank console that opens? It's not entirely clear.
View ArticleComment by HolyBlackCat on LLDB debugging doesn't work with std::cin
Repeating my comment from the staging ground: I see two different consoles on the last picture, it's not clear if you tried inputting into both. If both don't work, what happens when you try? You press...
View ArticleComment by HolyBlackCat on Perfect forwarding and non-type template parameters
You bolded the wrong part in temp.deduct.call, because the auto here (the referenced type) is not a template parameter at all. The part you bolded applies during CTAD when there are no custom deduction...
View ArticleComment by HolyBlackCat on Compiling GDB on Windows using msys2 in 2024
I'd look into how MSYS2 developers build it. They should have a PKGBUILD script for it.
View ArticleComment by HolyBlackCat on C braced initializer for -non- array
This isn't valid C, it stops compiling if you add -pedantic-errors.
View ArticleComment by HolyBlackCat on C++20 constinit and std::string
Common std::string implementations don't allocate dynamically if the string is short enough ("SSO"). Since the shortness threshold depends on the implementation, you probably shouldn't rely on it.
View ArticleComment by HolyBlackCat on Why can I define a std::string instance that is...
@wohlstad Clang 18 and newer accepts it.
View ArticleComment by HolyBlackCat on How can I declare a template that takes templated...
This would be better split up into several questions... The crash looks unrelated to all this, use your ASAN or a similar tool to debug it.
View ArticleComment by HolyBlackCat on constexpr function to generate unique error codes...
This is fundamentally impossible. You can only have 2 out of 3: constexpr-ness, ability to declare those in multiple places, and the IDs being sequental and always unique. If you abandon the latter...
View ArticleComment by HolyBlackCat on temporary object and copy constructor
It's very hard to understand what you tried to ask in that paragraph about RVO. :/
View ArticleComment by HolyBlackCat on Display Text in SDL2 and C++
Please add a minimal reproducible example, aka a complete program we can run ourselves.
View ArticleComment by HolyBlackCat on How to automatize build of library before main...
Since you want to improve the build process, I recommend switching to a cross-platform build system first.
View ArticleAnswer by HolyBlackCat for Why can I define a std::string instance that is...
Common std::string implementations don't allocate on the heap if the string is short enough (this is called the "short string optimization" or "SSO").Since the exact amount of characters that can fit...
View ArticleComment by HolyBlackCat on How to automate build of library before main...
Since you want to improve the build process, I recommend switching to a cross-platform build system first.
View ArticleComment by HolyBlackCat on Issue in Kali Linux
Obligatory reminder that Kali isn't supposed to be a distro for everyday use. kali.org/docs/introduction/should-i-use-kali-linux/…
View ArticleComment by HolyBlackCat on Can you open a C++ game made in VSCode from a...
If you can run your game already (e.g. in VSC), you must have produced an .exe from the .cpp files. That .exe can be ran directly, or a shortcut can point to it. And since you already have an .exe, you...
View ArticleAnswer by HolyBlackCat for How to create type T and value of type T template...
It's impossible to support this exact syntax (all 4 forms at the same time).The closest thing I can think of is:template <auto V = 0>struct Example {};Example<int(1)> a; // Type and...
View Article