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

Comment by HolyBlackCat on Issue with Makefile: Dynamic Port Selection Not...

Please read Why should I not upload images of code/data/errors? and update your question accordingly.

View Article


Why do different variations of glVertexAttribPointer exist?

There areglVertexAttribPointer()glVertexAttribIPointer()glVertexAttribLPointer()I assumed glVertexAttribPointer can be used instead of the other two.If so, why do the I and L variations exist?

View Article

Answer by HolyBlackCat for Is it possible to have the panel (in VSCode) sit...

You could drag of the files out into a separate window, then arrange the two windows side by side.

View Article

Comment by HolyBlackCat on `std::is_trivially_copyable` disagreement between...

Looks like a Clang bug to me...

View Article

Comment by HolyBlackCat on How to use C++'s "cin.fail()" function? This code...

You shouldn't add "resolved" to the title, or a solution to your post. If it wasn't closed, the way to go would be to post an answer below and press the checkmark next to it. But since it's closed,...

View Article


Comment by HolyBlackCat on C++ macro for defining enums and helper function...

@StephenNewell Integrating python into the build process is way more complicated than writing a macro, IMO.

View Article

Comment by HolyBlackCat on Declaration of dynamic array before getting array...

For some reason newbies always assume this will work, but it doesn't. The length of ar is fixed when you create it (and length is uninitialized at that time). The array will not track length and update...

View Article

Answer by HolyBlackCat for Who catches exceptions from copy-constructor in...

I believe this can be answered without language-lawyering.X f() {return ...;}Y y = f();This in general involves two copies (or two objects being created, rather), unless elided.First ... is copied into...

View Article


Answer by HolyBlackCat for C++ macro for defining enums and helper function...

The simple way to fix this is to add using ThisEnum = EnumName; to the intTo##EnumName(), and use that in ENUM_CASE instead of EnumName.But I wouldn't stop here. You can make a better call syntax for...

View Article


Answer by HolyBlackCat for Declaration of dynamic array before getting array...

After trying out different inputs, I found that length is changed to the first input integer, here 4.What likely happens is that length happens to be zero (keep in mind that reading it is UB due to it...

View Article

Comment by HolyBlackCat on passing int (&array)[] to a function C++

@JaMiT "prevents passing in a null pointer" is a good point. Regarding having to check for null pointers, I believe this is a misconception. You don't have to check for null pointers either way, you...

View Article

Comment by HolyBlackCat on What is a Rep in a time_point duration?

What documentation are you looking at? en.cppreference.com/w/cpp/chrono/time_point explains that "Rep [is] an arithmetic type representing the number of ticks of the duration". It's not very clear...

View Article

Comment by HolyBlackCat on What is a Rep in a time_point duration?

"every" is probably an overstatement.

View Article


Answer by HolyBlackCat for Counterintuitive template overload resolution

It doesn't actually pick the second overload. The problem is that std::tuple_element_t apparently is not SFINAE-friendly.Merely checking that overloaded requires calling std::tuple_element_t<2,...

View Article

Comment by HolyBlackCat on Why is std::noop_coroutine() non-constexpr?

@TedLyngmo I'm not sure if language-lawyer tag is appropriate. OP asks for rationale, and the standard isn't going to provide that.

View Article


Comment by HolyBlackCat on all runs are on external terminal

How do you run the code exactly? Pick one language and add all information. What button do you press to run the code? Do you have custom tasks.json/launch.json/etc? If yes, show them. Did you install...

View Article

Comment by HolyBlackCat on C++ .txt and UTF-8

UTF-8 encodes some characters with multiple bytes. Read about how it works. You should probably read 1..4 bytes (one character) and decode it into a 32-bit integer (char32_t or std::uint32_t), then...

View Article


Comment by HolyBlackCat on Convert PVOID to a function pointer?

In C++, unlike in C, void * is not implicitly convertible to other pointer types, you must explicitly convert (aka "cast") it. Your code doesn't do a cast, and attempts an implicit conversion.

View Article

Comment by HolyBlackCat on Why does the == operator not work with float?

Enable your compiler warnings.

View Article

Comment by HolyBlackCat on how to run C++ code in Visual Studio Code

Tell us what exactly you do, what errors you get, what .json files have you created if any, what extensions you're using, etc. There's nothing wrong with mingw, don't need to drop 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>