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

Comment by HolyBlackCat on Why '-pedantic-errors' flag/switch is not catching...

@Peter The "escape routes ... only for use in system headers" part apparently only applies to __intN__ and __extension__ extensions. Some other extensions are unavoidable.

View Article


Comment by HolyBlackCat on What is the correct way to implement a custom...

There are built-in range formatters, you shouldn't write your own.

View Article


Comment by HolyBlackCat on Compile and Run dynamic C++ code inside react...

Termux ships Clang for android, copy what they do.

View Article

Comment by HolyBlackCat on class template argument deduction when non-type...

"there is a good indication this will become possible in C++26" Huh! Is there a proposal

View Article

Comment by HolyBlackCat on std::print() wrapper with altered format

decoratedPrint<"format">(args...) or decoratedPrint("format"_c, args...) are possible, but that's silly.

View Article


Comment by HolyBlackCat on std::print() wrapper with altered format

@康桓瑋std::format_string still validates the decoratedPrint's arguments. The only possible source of errors is incorrectly modifying the format string inside of it.

View Article

Comment by HolyBlackCat on Is it ok to cast a temporary object to rvalue...

Is the function under your control? Can you change the parameter to a pointer?

View Article

Comment by HolyBlackCat on Unable to cross compile simple C program using...

Using a full triplet --target=ppc64le-linux-gnu seems to work. I also needed -nostdlib to fix the next error.

View Article


Comment by HolyBlackCat on error, "SFML/Graphics.hpp: No such file or directory"

Uninstall winlibs and replace it with msys2. Msys2 not only lets you install the compiler, but also a compatible SFML.

View Article


Comment by HolyBlackCat on Why the order of elements doesn't matter in a class?

Function bodies are processed separately after the rest of the class.

View Article

Comment by HolyBlackCat on Why do the IO library and the Diagnostic library...

When you implement << and >> for your class, they accept a reference to the stream base class. How else could that work? (Yes, there are some possible alternative designs, but inheritance...

View Article

Comment by HolyBlackCat on PyBind11 produces pyd file without any class i...

When you run python, is the .pyd in the current directory? If you print something inside of PYBIND11_MODULE, does it get printed when you import the module?

View Article

Comment by HolyBlackCat on Why do some parts of the C++ standard library use...

When you implement << and >> for your class, they accept a reference to the stream base class. How else could that work? (Yes, there are some possible alternative designs, but inheritance...

View Article


Comment by HolyBlackCat on Is `*this = *obj` safe to use in C++?

@anatolyg Yep, I suggest that in the last paragraph.

View Article

Comment by HolyBlackCat on I'm stuck at an error when installing the DPP library

Please add the output of which cmake and which g++.

View Article


Comment by HolyBlackCat on I'm stuck at an error when installing the DPP library

What makes you think they don't support mingw? Just tried building it with it, didn't have any issues.

View Article

Comment by HolyBlackCat on Why are some types left uninitialized when default...

"could lead to much worse errors" I guess. Even destroying them would crash.

View Article


Comment by HolyBlackCat on Tricks to avoid pointer aliasing in generic code

Perhaps make local pointers to the iterator contents, and make them __restrict?

View Article

Answer by HolyBlackCat for Why are some types left uninitialized when default...

They (vectors and strings) would be very hard to use correctly if they could be uninitialized.Let's say the vector is designed so that std::vector<int> v; is uninitialized. If after that you do v...

View Article

Comment by HolyBlackCat on Is it safe to pass a lambda that is going out of...

This is impossible to answer in general (depends on how exactly you store the lambda). If you store it in std::function then you're safe, it always stores a copy.

View Article
Browsing all 1285 articles
Browse latest View live


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