Message from C, C++ discussions

January 2020

— Oh god.. why do you need to cast pointers here?
why not just cast the value?

about the error, how Offset::LevelTime is declared? Don't post photos, post the code (use https://pastebin.com/ if the code snippet is big)

Message permanent page

— 

A funny story happened to me this week. I'm not a fan of complex templates but decided to write a bitset class that can be parameterized with a enum (so I can use enum values as bit flags).
And to top of that, I wanted to add some handy functions for checking multiple values at once, using variadic templates.

So this is code I wrote (my thoughts were "oh, is it that simple?").
https://pastebin.com/HcDS7zmz
It compiled, run... but tests were failing for some reason...

I investigated a bit and found out that only the first values are considered in the function calls, and it seemed like I didn't actually use variadic templates. Seems like I used some kind of variadic functions (never used them before, so can't be sure).

Finally, I've rewritten it using real variadic templates. Become much more verbose, but at least it works correctly now (the bitset size is still not good, I'll replace it with magic_enum library call magic_enum::enum_count<T>() ).
https://pastebin.com/Dtxw0rTu

Funny thing that if I didn't write tests for it, I could leave this code as it was and added some hard to catch bugs to my project. And I decided to write the tests only because the code was actually crashing (as I understand because of stack overflow on the bitset allocation, because of too big size).

— Lol bloat magic

— Does someone know this?

— Can i ask question about js

— Quick question

— I dont think people (of the type admin) would like that

— Ok

— You can probably find a js chat on telegram tho and ask there

— Hi

— Which tools are great for checking memory foorprint and leakage of c++ programs in Windows.. I have tried valgrind on Linux. But need similar on windows.

Message permanent page

— Podi pulle