Comment by HolyBlackCat on Parsing Open Files Stuck in Infinite Loop for...
** shouln't be necessary. Surely you aren't passing every individual subdirectory in an -I flag to your compiler?
View ArticleAnswer by HolyBlackCat for Can the semantics of a translation unit depend on...
I see at least two ways that unused functions can affect behavior:They can instantiate templates:...that can have static variables with constructors with side effects....that can perform stateful...
View ArticleComment by HolyBlackCat on How does the validity of pointers interacts with...
int *arr; by itself is legal, int *another = arr; I think stops being UB in C++26?
View ArticleComment by HolyBlackCat on C++20: strange difference between std::less() and...
Your class doesn't support == (and !=, but you don't need to define the latter manually when you have the former). std::ranges::less wants a full set of comparison operators, even though it doesn't use...
View ArticleComment by HolyBlackCat on Why there no constructors for associative...
s/foo/bar/ is a sed command to replace string foo with bar. Adding g at the end means replacing all matches instead of one. This is a fancy way of telling someone they should've said something...
View ArticleComment by HolyBlackCat on lld cannot open /lib/x86_64-linux-gnu/libm.so.6 in...
"replacing libm.so with libm.so.6" What do you mean "replacing"?
View ArticleComment by HolyBlackCat on collect2.exe: error: ld return 1 exit status
@AhmedAEK Building from source requires installing a bunch of dependencies. ...which can be conveniently installed from MSYS2, but at that point you might as well install the whole SFML.
View ArticleAnswer by HolyBlackCat for Passing a vector of pointers as an argument on the...
Rather than having the wrapper forward arguments to the constructor (adding unnecessary moves in some cases even if done using perfect forwarding; and just not looking good to my taste), I'd do...
View ArticleComment by HolyBlackCat on C/C++ plug-ins in vscode how to detect the macro...
First you generate compile_commands.json. On Linux bear does that, on Windows you can somehow parse it from the output of make --debug=print (or something similar). It contains all compiler flags. Then...
View ArticleComment by HolyBlackCat on Problem with release of dynamic allocations
Your code is bugged, what else can we say?
View ArticleComment by HolyBlackCat on Is it a good idea to use `std::move` with a...
@PepijnKramer std::move doesn't always express ownership transfer. In a template, it can very well express "I'm not going to use this object anymore, you can do whatever you want with it" (i.e....
View ArticleComment by HolyBlackCat on Is it possible to install `lsblk` in MSYS2?
MSYS2 is a shallow imitation of Linux, I'm not surprised it can't do it.
View ArticleComment by HolyBlackCat on Linker can't find SDL & CRT symbols?
Start by pasting the error as text from the 'output' tab (not some screenshot). Also explain what exactly you did, don't just say that you followed a book. AND DON'T SHOUT.
View ArticleComment by HolyBlackCat on Mac clang++ C++ run and compilation:
clang is a C compiler, use clang++ for C++. -std=c++11 should've helped, if it didn't it means you're not actually using tasks.json (perhaps you use the "code runner" extension that doesn't use this...
View ArticleComment by HolyBlackCat on How to make `std::from_range` move the elements...
@康桓瑋 That's why I also suggest checking std::borrowed_range == false. But I'm no longer sure this is enough...
View ArticleComment by HolyBlackCat on Combining if constexpr() with non const condition
This doesn't compile.
View ArticleComment by HolyBlackCat on Can I mark a function with noexcept if it has an...
You can test this yourself, by making a class that always throws in copy ctor. IIRC parameters are constructed outside of the function, and are not covered by noexcept.
View ArticleComment by HolyBlackCat on makefile for C I cant help to figure out whats wrong
You need to specify the directories for files to the left of : too.
View ArticleComment by HolyBlackCat on Libclang way slower to parse AST than -ast-dump...
Is this a release build of libclang?
View ArticleAnswer by HolyBlackCat for How to make `std::from_range` move the elements...
Judging by Is there a move-or-copy equivalent of std::forward for perfect forwarding in std::ranges?, not only there's no built-in solution, but also std::borrowed_range<U> == false is not the...
View Article