↧
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 ArticleComment 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 ArticleComment 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 ArticleComment 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 ArticleComment by HolyBlackCat on Pointer to abominable function type? Compiler bug?
I suggest reporting those bugs...
View ArticleComment by HolyBlackCat on Passing a string literal to a template char array...
@Weipeng They likely mean the mutable keyword.
View ArticleComment 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 ArticleComment by HolyBlackCat on How to generalize the a template specialization...
Yep, you just replace std::tuple with a template template parameter.
View ArticleComment 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 ArticleAnswer 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 ArticleAnswer 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 ArticleComment 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 ArticleComment by HolyBlackCat on Expression templates cppcon 2019
I have to ask: You know Eigen exists, right?
View ArticleComment by HolyBlackCat on In installation of VS Code
Can you screenshot the error message?
View ArticleComment 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 ArticleComment 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 ArticleComment by HolyBlackCat on string_view
@MarekR You're allowed to reinterpret any type as char.
View ArticleAnswer 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 ArticleAnswer 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
More Pages to Explore .....