Comment by HolyBlackCat on Issues Linking Google Benchmark with g++ on...
You shouldn't have to guess compiler flags, pkgconf --libs --cflags benchmark should print the correct flags (but you might need to set PKG_CONFIG_PATH to the pkgconfig directory of vcpkg) (or just...
View ArticleComment by HolyBlackCat on How to convert a template type into a new type
Which of the classes are under your control? You could move e.g AD to be a member class of A with a fixed name (so AD becomes A::foo and BD becomes B::foo).
View ArticleComment by HolyBlackCat on SFINAE way to conditionally declare and define a...
So there can be different severity enums, the user can specify their own?
View ArticleComment by HolyBlackCat on Correct way to build uwebsocket dependencies on...
My MSYS2 does include cc.exe. It also includes some of the dependencies you need as prebuilt packages (at least uv and zlib). I'd start by replacing your mingw with it, installing those packages, and...
View ArticleComment by HolyBlackCat on How to handle conflict between virtual destructor...
"What should a Derived1 instance do to copy (or move from) a Derived2 instance?" This is not for Base to decide. It should copy its own members, and let the derived classes copy theirs. It might be...
View ArticleComment by HolyBlackCat on Should std::variant be nothrow destructible when...
But this is defective, right? Since union doesn't automatically call the member destructor, it shouldn't affect noexceptness of the enclosing class destructor.
View ArticleComment by HolyBlackCat on Name not showing when program "runs"
Also please replace the pictures with actual text. See Why should I not upload images of code/data/errors? for why.
View ArticleComment by HolyBlackCat on Why the compiler still complains even if...
Removing -ltsan fixes this. You don't need to link it manually, passing -fsanitize=thread to the linker too is enough.
View ArticleComment by HolyBlackCat on Chess symbols aren't displaying in command prompt
You can change the background color of the printed text. Then the unicode characters should work for you.
View ArticleComment by HolyBlackCat on Ask cmake to use an old version of C++ to compile...
Please post the beginning of the error, not the last lines.
View ArticleComment by HolyBlackCat on Ignoring "#include"s only in the released library?
Moving extern template to the .hpp sounds like a good idea. And then you can get rid of .ipp altogether, and move the definitions to the .cpp.
View ArticleComment by HolyBlackCat on How to avoid dangling pointer in C++
Seeing that SPA_PROCESS_LATENCY_INFO_INIT expands to a compound literal, it shouldn't compile in C++ in the first place (assuming -std=c++?? -pedantic-errors). You just don't use this macro, and create...
View ArticleComment by HolyBlackCat on My VS Code is not unable to run the C program
Show the error message.
View ArticleComment by HolyBlackCat on Why can't the terminal display Chinese normally?
Are you asking why it doesn't work without the locale? Because the default encoding on Windows is something weird rather than UTF-8.
View ArticleAnswer by HolyBlackCat for How can I disambiguate a constructor call with...
Another option: (Class(i));Braces can have different semantics than parentheses in some cases (not in yours), and I'd rather not think about this in general.
View ArticleComment by HolyBlackCat on Where should a random generator be stored in C++?
Why preserve std::random_device and the seed when you only need them once?
View ArticleComment by HolyBlackCat on GCC/clang and Visual C++ structure compatibility...
Clang on Windows can run either in msvc-compatible mode or in mingw mode. How are you running it?
View ArticleComment by HolyBlackCat on In C++ I am successfully compiling Rvalue as if it...
Try with /std:c++latest.
View ArticleComment by HolyBlackCat on Where is z_uncompress and z_compress defined in zlib?
I think by default they're called compress and uncompress, but there's some setting to rename the funcs.
View ArticleComment by HolyBlackCat on Why can't I pass std::isfinite as a predicate...
But this is still UB, right? std::isfinite is not specified to be addressable? Can I take the address of a function defined in standard library?
View Article