Quantcast
Channel: User HolyBlackCat - Stack Overflow
Browsing all 1348 articles
Browse latest View live
↧

Comment by HolyBlackCat on Why are C++ guranteed copy elision not chainable?

It's not about it not being chainable, it is chainable. There's no guaranteed copy elision when returning a variable, only when returning a prvalue.

View Article


Comment by HolyBlackCat on undefined reference to `WinMain@16' in openGL C

What tutorial are you using? You need -lmingw32 -lSDL2main -lSDL2 (in this order), not just -lSDL2. This is likely what you're missing. Also an obligatory reminder that your GCC is outdated (6, while...

View Article


Comment by HolyBlackCat on Real const shared instance

"Doctor, it hurts when I do this." "Then don't do that!" Just don't retain the original non-const pointer. DataHolder dataHolder(std::make_shared<Data>(Data{5}));.

View Article

Answer by HolyBlackCat for concept to check "A" is derived from "B"

You check this by attempting to call a dummy (templated) function accepting a pointer to the base. This will reject inaccessible or ambiguous bases, but this is usually desirable.namespace detail{...

View Article

Answer by HolyBlackCat for undefined reference to `WinMain@16'

You're missing the main() function (or WinMain()).If you do have one, you probably forgot to save your source code, and ended up compiling an empty file (without main()).You can use either main or...

View Article


Answer by HolyBlackCat for C++ variadic template with values instead of...

This syntax isn't viable, because most types can't be template parameters. Among other things, you can't pass string literals (there are workarounds, but they don't work for your case).The only viable...

View Article

Comment by HolyBlackCat on "addin.XLL is in a different format" issue, cannot...

@Ajax Try this one.

View Article

Comment by HolyBlackCat on Variable assignment in gmake seems broken?

FYI, you can do override CFLAGS = ..... to ignore the command-line parameters.

View Article


Comment by HolyBlackCat on Pass lambda to templated function with deduced types

You moved a function pointer but didn't move the std::function parameter, looks like a typo.

View Article


Comment by HolyBlackCat on Pass lambda to templated function with deduced types

@gruszczy gcc.godbolt.org/z/54Kzh9rT4

View Article

Comment by HolyBlackCat on C++ std::unique_ptr deleter syntax

@Red.Wave And also this doesn't waste memory on a function pointer!

View Article

Comment by HolyBlackCat on How to build to Android from Windows with the...

MinGW is unrelated to Android, it compiles for Windows.

View Article

Comment by HolyBlackCat on Why does it say undefined reference even though...

Latest version of mingw? You're on GCC 6, while the latest is 14. You can get the latest one from MSYS2 (along with SDL2, so you don't have to install it manually).

View Article


Comment by HolyBlackCat on static assertion fires from return type when...

The substitution happens before this elimination as per eel.is/c++draft/over.over#3, and the error happens during that substitution. Which means the program is ill-formed, I believe?

View Article

Comment by HolyBlackCat on How does Clang find it's default sysroot / target...

And instead of setting the env variable manually, you can run also run clang from the VS developer prompt.

View Article


Comment by HolyBlackCat on Clangd auto-inserts C++ headers instead of C headers

What do you mean by "imports"? Auto-inserts them when completing functions from them?

View Article

Comment by HolyBlackCat on Forbid temporary lifetime extension in C++

There's nothing you can do.

View Article


Answer by HolyBlackCat for Are pointers addresses in C?

In practice pointers are addresses (except perhaps on some very obscure platforms), but there are additional restrictions attached to them (the compilers can optimize with the assumption that you don't...

View Article

Comment by HolyBlackCat on How to connect CMake to Qt6 static?

Install CMake in MSYS2 too. The log shows you're using an external one.

View Article

Comment by HolyBlackCat on Error linking files with wam-ld when linking c...

Try building in verbose mode to see what the linker command is. Also try -pthread instead of -lpthread. And CMAKE_EXE_LINKER_FLAGS.

View Article
Browsing all 1348 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>