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

Comment by HolyBlackCat on Not able to make an object of a class in a...

Either Server needs to have a default constructor (i.e. with no parameters), or it must be initialized in the member initializer list.

View Article


Comment by HolyBlackCat on When is an erroneous value not valid for the...

@JanSchultke I think it's as bad as it looks. It improved safety for the other scalar types, but not for bool. Which is better than nothing.

View Article


Comment by HolyBlackCat on deleted template class constructor but there is a...

You found a Clang bug, nice job. You can do this e.g. by adding requires to the whole class.

View Article

Comment by HolyBlackCat on deleted template class constructor but there is a...

I would rather add requires to the whole class.

View Article

Comment by HolyBlackCat on When is an erroneous value not valid for the...

Why OP's example isn't UB?

View Article


Comment by HolyBlackCat on Performance of passing std::string by value in...

I've heard that moving a string can be more expensive than copying it for short strings. But I wouldn't bother with this, since in general your approach is the best one.

View Article

Comment by HolyBlackCat on What is the significance of 'strongly happens...

@Denis eel.is/c++draft/atomics.order#1.4 A seq_cst read counts as an "acquire operation".

View Article

What is the significance of 'strongly happens before' compared to '(simply)...

The standard defines several 'happens before' relations that extend the good old 'sequenced before' over multiple threads:[intro.races]11 An evaluation A simply happens before an evaluation B if...

View Article


Comment by HolyBlackCat on In a Polyscope C++ project, how can I print to the...

Maybe you build in "subsystem=windows" mode that hides the console. There should be a setting somewhere in the project settings. Setting it to "subsystem=console" should unhide it. Or use...

View Article


Comment by HolyBlackCat on How can `if constexpr` be made SFINAE-friendly?

@alfC Alright, see edit.

View Article

Comment by HolyBlackCat on Why can't the MinGW version of Git (Git for...

@ILikePython The idea itself could make sense (Git for Windows normally uses a separate modified MSYS2 installation, so it could be desirable to merge them), so I guess they explain this for people who...

View Article

Comment by HolyBlackCat on Retrieving from gcc/clang a value known at...

#define doesn't add anything useful. OP wants to print at compile-time, not runtime.

View Article

Comment by HolyBlackCat on C++: std::shared_ptr and memory_order

Your analysis sounds correct to me.

View Article


Answer by HolyBlackCat for Warning when iterating over a map in a range-for...

The map stores std::pair<const int, unsigned> objects, with the first type being const.

View Article

Comment by HolyBlackCat on dummy reference when calling function

Arguably a pointer is better because the function can check if it's null, and then avoid computing the useless value.

View Article


Comment by HolyBlackCat on cpp expression must be a modifable !value

[0][0] rather than [0, 0]. And the error probably mentioned Lvalue, not !.

View Article

Comment by HolyBlackCat on Web VSC != Desktop VSC

Nobody can help if you if you don't say what errors you get.

View Article


Comment by HolyBlackCat on Deduce template parameters for std::variant...

How do you accept types derived from std::variant, and how do you extract the template arguments of std::variant.

View Article

Comment by HolyBlackCat on defining new and delete as macros?

Looks useless. (And if you can't match the original call syntax with macros, at least name them differently.)

View Article

Comment by HolyBlackCat on header file missing on mingw-w64-ucrt

The file is there for me. Did you forget to update your compiler?

View Article
Browsing all 1285 articles
Browse latest View live