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

Comment by HolyBlackCat on cross compile mysql C API on ubuntu 22.04 for...

Yes, any library you use must be compiled with mingw, including this mysql C API.

View Article


Comment by HolyBlackCat on Is there a function can modify map's value and...

This is worse than .insert_of_assign because it default-constructs the missing element just to overwrite it later.

View Article

Comment by HolyBlackCat on C++ preprocessor macro with and without arguments

On MSVC you need /std:c++latest /Zc:preprocessor (or c++20 instead of c++latest).

View Article

Comment by HolyBlackCat on Understanding memory allocation and resizing of...

What is unclear in the tutorials you have read so far? Do they not explain something you want to know? Without understanding what you don't understand, best we can do is to link to you to another...

View Article

Comment by HolyBlackCat on ARM STM32 Keil. #ifndef FILE_H, #ifndef _FILE_H_,...

@john Why is that?

View Article


Comment by HolyBlackCat on Pointer to abominable function type? Compiler bug?

I suggest reporting those bugs...

View Article

Comment by HolyBlackCat on Passing a string literal to a template char array...

@Weipeng They likely mean the mutable keyword.

View Article

Comment by HolyBlackCat on How does `m[k] += x` work when the map `m` has no...

[] creates a zeroed element if it doesn't exist (as if by T()).

View Article


Comment by HolyBlackCat on How to generalize the a template specialization...

Yep, you just replace std::tuple with a template template parameter.

View Article


Comment by HolyBlackCat on Assign member before constructor run

Doesn't this have the same problem? The argument of the private constructor will be evaluated before the member variables are initialized.

View Article

Answer by HolyBlackCat for Integer overflow warning only when using const...

Short answer: the compiler is just not smart enough. Both functions result in the same UB.

View Article

Answer by HolyBlackCat for Assign member before constructor run

Another option: Move your member variable to a helper base class (probably a private base with a protected member).Inherit from this helper base first, and your BaseClass second, then it's members will...

View Article

Comment by HolyBlackCat on This glutIntWithExit@12error occurs How can I...

Please show the full error message. And check for typos please ("gult" or "glut"?).

View Article


Comment by HolyBlackCat on Expression templates cppcon 2019

I have to ask: You know Eigen exists, right?

View Article

Comment by HolyBlackCat on In installation of VS Code

Can you screenshot the error message?

View Article


Comment by HolyBlackCat on How can I point a void pointer to different...

Base * is not an "instance of Base", so it works regardless of it beng abstract.

View Article

Comment by HolyBlackCat on C++ class template: define a type used in...

If only there was some way to prevent the user from manually setting this template parameter.

View Article


Comment by HolyBlackCat on string_view

@MarekR You're allowed to reinterpret any type as char.

View Article

Answer by HolyBlackCat for Any utility to test expand C/C++ #define macros?

Any Clangd-based IDE can expand macros, e.g. VSCode with the Clangd plugin (instead of the stock C/C+ one).Position your cursor onto the macro, CtrlShiftEnter -> 'expand macro'.

View Article

Answer by HolyBlackCat for Different behavior reason when overloading + and...

Comparison operators got an upgrade in C++20 (along with introduction of <=>), which among other things makes == symmetric, lets you skip defining != (a != b behaves as !(a == b) when there's no...

View Article
Browsing all 946 articles
Browse latest View live




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