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

Comment by HolyBlackCat on Is it legal to initialize an array via a functor...

@CygnusX1 I meant that the temporary created by returning by value is not copied/moved to arr, but rather merged with it. I guess "RVO" isn't the right word, this is mandatory copy elision from C++17.

View Article


Comment by HolyBlackCat on How to find Equivalent flags in linux and windows?

Read the help pages of the respective commands.

View Article

Comment by HolyBlackCat on Error returning an array from a consteval function

You return a dangling pointer.

View Article

Comment by HolyBlackCat on Uniform initialization is not working with my...

@AlanBirtles OP knows they can pass -std=c++11, they are confused about something more fundamental.

View Article

Comment by HolyBlackCat on Are there any C++ resources/websites out there...

There are a few automatic tools that can help you (enabling compiler warnings, iterator validation, address sanitizer and UB sanitizer...). But using them requires at least some knowledge.

View Article


Comment by HolyBlackCat on sdl.h: no such file

You should monitor your question after posting it, to answer any comments.

View Article

Comment by HolyBlackCat on If a lambda is declared as a default argument, is...

@user12002570 I've reopened this. Dupes look unrelated. Unlike this question, there's no technical reason why the funciton couldn't be instantiated twice with two different lambda types. This is simply...

View Article

Comment by HolyBlackCat on If a lambda is declared as a default argument, is...

"should fail for same reason as..." This example is different because you spell the lambda twice.

View Article


Comment by HolyBlackCat on If a lambda is declared as a default argument, is...

I agree that this is the correct answer, but if you're gonna quote the same quotes as the other answer, I suggest explaining why your interpretation is correct and theirs isn't.

View Article


Comment by HolyBlackCat on How to install free OPC UA C++ to Windows?

rem ... are comments in the build script, you can ignore them.

View Article

Comment by HolyBlackCat on How do I determine the distance between point (x1,...

Please add your code as text (not screenshots), so we can copy and run it ourselves. And say what is the specific problem with it you're having.

View Article

Answer by HolyBlackCat for Assign unique_ptr of derived class to a base class

Another option is to provide an initializer for Base:std::make_unique<Derived>(Base{}, 5)And, as mentioned in the other answer, don't forget to add a virtual destructor to Base.

View Article

Comment by HolyBlackCat on If a lambda is declared inside a default argument,...

"should fail for same reason as..." This example is different because you spell the lambda twice.

View Article


Comment by HolyBlackCat on If a lambda is declared inside a default argument,...

The real question is not why this creates only one lambda type, but rather why having a lambda as a default template argument creates a new lambda every time.

View Article

Comment by HolyBlackCat on If a lambda is declared inside a default argument,...

I agree that this is the correct answer, but if you're gonna quote the same quotes as the other answer, I suggest explaining why your interpretation is correct and theirs isn't.

View Article


Comment by HolyBlackCat on Cross Compile C Using Clang - can't find header files

Coping /include is not enough, you must copy / (with /usr/include, /usr/lib at least). and specify the path to that /.

View Article

Comment by HolyBlackCat on ISO C++ forbids using pointer to a function in...

((char *)func_end - (char *)func_start + 1) should compile, but I also wonder why would anybody need to subtract those.

View Article


Comment by HolyBlackCat on Is it possible to implement a recursive POD...

Uhhh. Make Vector2f get_start() and same for end, and use them in your sum(). But I question the value of wrapping such simple types instead of writing them from scratch and providing functions to...

View Article

Comment by HolyBlackCat on Why are there redundant slashes in comment headers...

"To make it move visible" is the answer to "why a bunch of * instead of nothing". While OP is asking something else, they ask "why ****//** instead of ***** when you can make the latter work by...

View Article

Comment by HolyBlackCat on Why are there redundant slashes in comment headers...

The answer is simple, the developers either don't know about the setting, or can't be bothered to set it.

View Article
Browsing all 946 articles
Browse latest View live




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