Quantcast
Browsing all 1306 articles
Browse latest View live

Comment by HolyBlackCat on Why destructor needs to be accessible even when it...

@PeteBecker Doesn't mandatory copy elision prevent that?

View Article


Comment by HolyBlackCat on why my LLDB Debugger is not working even though...

Try lldb-dap instead of the stock debugger extension. And I just so happen to be writing a tutorial on configuring VSC with Clang, maybe it'll help: link.

View Article


Comment by HolyBlackCat on Any way to name tuple items?

It's possible to iterate over struct members with names, see boost.pfr.

View Article

Comment by HolyBlackCat on No include path in which to find stdio.h error

Please add information about where exactly you downloaded MinGW. There are many different versions (and apparently you installed a bad one).

View Article

Comment by HolyBlackCat on Warning to discover unnamed variable

Firstly, this is parsed as std::lock_guard<std::mutex> mutex;, and causes a compilation error because lock_guard is not default-constructible. If I replace (...) with {...}, then Clang with...

View Article


Comment by HolyBlackCat on Should the inline keyword be used for variables in...

What would (1) do for variables (as opposed to functions)?

View Article

Comment by HolyBlackCat on "undefined reference to `WinMain@16'" error in VS...

@PaulMcKenzie "means that you are building a Windows GUI program" Nope. MinGW accepts both main and WinMain in both console and GUI programs. If you provide neither, it'll always complain about WinMain.

View Article

Comment by HolyBlackCat on std::unordered_set with memory location control?

std::unordered_... containers don't move the elements in memory, that's why they're slower than many third-party hashmap implementations.

View Article


Comment by HolyBlackCat on C programming language Undefined behavior

The code is legal, and the book is garbage.

View Article


Comment by HolyBlackCat on I am encountering a JSON error whenever I run C++...

Show your launch.json, tasks.json, and any other configuration files you've written.

View Article

Comment by HolyBlackCat on Define macro to another macro : a hack to...

Stateful metaprogramming can do this without any macros: github.com/DaemonSnake/unconstexpr-cpp20 But as it's very complex, it's probably an overkill in this case.

View Article

Comment by HolyBlackCat on How to compile and run a C script in MSYS2

Note that MSYS2 ships several different builds of GCC, and you're using a cygwin-based one right now.

View Article

Comment by HolyBlackCat on Is statement in C++, i.e., instructions ends with...

@NicolBolas "Which it is." But it isn't? A data race by definition requires a non-atomic object to race on, but there's none. eel.is/c++draft/intro.races#def:data_race

View Article


Comment by HolyBlackCat on Does early return of the same variable prevent NRVO?

You can test it on your preferred compilers by replacing the vector with your own class with logging in copy/move constructors.

View Article

Comment by HolyBlackCat on Cant paste in vscode

Do you have this program installed perhaps? github.com/EslaMx7/PasteIntoFile

View Article


Comment by HolyBlackCat on "No include path in which to find stdio.h" error

What does where gcc print?

View Article

Comment by HolyBlackCat on Does the C++ standard library have function types...

There are std::function_ref (or std::move_only_function) that can be used instead of std::function to accept non-copyable types. But those are fairly new, C++26 and C++23 respectively.

View Article


Comment by HolyBlackCat on Re-using a variable in a for loop in Cpp

It looks ok, but why would you do it? Why not create a separate variable? The compiler should be able to merge them if they're not used at the same time.

View Article

Comment by HolyBlackCat on How do I get gpg to generate a GPG Key public ring...

I came here because use_keyboxd broke my scripts. Ended up using gpgv instead of gpg. (It's a signature verification tool, a stripped down version of gpg.)

View Article

Comment by HolyBlackCat on How to binary search a std::vector BUT that return...

I'd call them "named requirements" or something like that, to avoid confusion with actual concepts.

View Article
Browsing all 1306 articles
Browse latest View live


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