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

Comment by HolyBlackCat on Error in Cygwin seems to mismatch the description

Don't add "solved" to the title. Click the checkmark on an answer to mark your question as solved.

View Article


Overloaded `&&`/`||` operators in concepts and requires-clauses

I made a macro for the "implies" operator. It works fine in general, but breaks on Clang when used in a concept or a requires-clause.run on gcc.godbolt.orgnamespace detail{ template <typename T>...

View Article


Comment by HolyBlackCat on Overloaded `&&`/`||` operators in concepts and...

I do check static_assert(A<int>); though. So this should be ill-formed?

View Article

Comment by HolyBlackCat on MSYS2 MinGW x64 shell in Visual Studio Code opens...

FYI msys2_shell.cmd needs -no-start -defterm to not open a new window. But I remember that I ended up running bash directly like you did.

View Article

Comment by HolyBlackCat on Ternary operator and prolonging the lifetime of a...

Apparently this was a compiler bug. All modern compilers I'm testing print Processing first.

View Article


Answer by HolyBlackCat for Ternary operator and prolonging the lifetime of a...

const Foo& local = frobnicate ? static_cast<const Gizmo&>(Frobnicate(arg)) : arg;Your solution is correct. Lifetime extension does propagate through static_casts, among other things, so...

View Article

Comment by HolyBlackCat on Is [[likely]] redundant if [[unlikely]] exists in...

I've reopened this because the dupes (from the first glance) don't talk about the equivalence of those 3 options. Perhaps consider changing the title so it looks less like a dupe.

View Article

Comment by HolyBlackCat on To obtain correctly aligned memory in the...

@user2138149 operator new returns memory aligned to __STDCPP_DEFAULT_NEW_ALIGNMENT__ (that's 16 on all platforms I just tested) if you don't specify alignment yourself. I think that even if you specify...

View Article


Comment by HolyBlackCat on What syntax am I missing for C++ mathematical...

Integer division (9/5) rounds down. Try 9.0 / 5.0 or something like that.

View Article


Why set the stop flag using `memory_order_seq_cst`, if you check it with...

Herb Sutter, in his "atomic<> weapons" talk, shows several example uses of atomics, and one of them boils down to following: (video link, timestamped)A main thread launches several worker...

View Article

Comment by HolyBlackCat on sdl2 library not building

You got a wrong version of SDL2, incompatible with your compiler. I recommend redownloading it from MSYS2 along with the compiler, that will surely be compatible.

View Article

Comment by HolyBlackCat on How to test concepts retroactively based on...

This is a consequence of declaring operators in the wrong namespaces. They must be where ADL can find them, so the one for std::pair would need to be in namespace std (which is illegal, therefore your...

View Article

Comment by HolyBlackCat on How to not display "staging" button in vscode?

I doubt VSC lets you customize this. It's open-source though, you can modify the source and build your own version of it.

View Article


Image may be NSFW.
Clik here to view.

Answer by HolyBlackCat for Most concise way to disable copy and move semantics

It's enough to delete the copy operations, then the move operations will get removed automatically.But if you're asking for "concise", according to this chart (by Howard Hinnant):The most concise way...

View Article

Comment by HolyBlackCat on Installing MingGW for C++

Did you download MSYS2 from the official site? Did you try uninstalling it completely and then reinstalling, from a freshly downloaded installer?

View Article


Comment by HolyBlackCat on Ambiguous Overload only for MSVC

@MarekR The member function's parameter type is more specialized, so I'm not surprised.

View Article

Comment by HolyBlackCat on Why does clangd not find all references?

Does compile_commands.json include the offending files?

View Article


Comment by HolyBlackCat on #pragma comment(lib, "xxx.lib") in androidsutdio...

@pepijnkramer The question says that the new Clang does support it, and the error does look like it sort of works.

View Article

Comment by HolyBlackCat on Why std::optional uses two bytes?

I don't see why you couldn't return a reference. "Since there would not be any bool object" Create it with placement-new.

View Article

Comment by HolyBlackCat on How do I write a range-based for loop in C++ which...

To be honest, I wouldn't trust the compiler to optimize this as well as a plain loop.

View Article
Browsing all 1285 articles
Browse latest View live


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