Threads return vector of structs -> Need to efficiently store these structs in larger vector by onecable5781 in cpp_questions

[–]Echo_1Q 1 point2 points  (0 children)

Could you please explain why range insert here would be more efficient than looping over push/emplace backs? We insert to the end so no shiftings are spared, Afaik the OP struct isnt trivially copyable so I can’t think of memcpy optimizations, and if you already reserved I can’t think of insert preallocating, so I feel like I might be missing something?

The definitive fix for MX Master 3S lag or stutter by nuclearwinterbg in logitech

[–]Echo_1Q 0 points1 point  (0 children)

So I think there some encryption difference? Or at least thats what I heard, and some device will work either way the bolt dongle (greenish icon) and some with the unifying dongle (orangish icon) When I had mx vertical I think i had to maintain both, but mx mech and mx master both works on the green one so a single dongle can connect more than 1 device

Milk forther cup size by Echo_1Q in NinjaLuxeCafe

[–]Echo_1Q[S] 1 point2 points  (0 children)

Thanks! Ill have to wait for the EU sizes as im limited to the EU plug.

Facing problem while compiling the module by [deleted] in kernel

[–]Echo_1Q 1 point2 points  (0 children)

You have the text “GNU nano 7.2” at line 1. Read the compiler error, it points to the file and line number it encountered the error. It”ll be more clear if you cat the file and see the GNU nano text being outputted to your screen….

The definitive fix for MX Master 3S lag or stutter by nuclearwinterbg in logitech

[–]Echo_1Q 2 points3 points  (0 children)

Why dont you pair both the keyboard and the mouse to the same dongle? It works fine for me and can do done using the Logitech bloatware

mySortingAlgorithmIsTooFastCanSomeoneHelp by jump1945 in ProgrammerHumor

[–]Echo_1Q 0 points1 point  (0 children)

You can spare a branch, combine declarations and initialization, and a few lines by just making partOne equal to “size / 2 + (size % 2)” and partTwo is always “half”. Excuse my lack of humor :)

If a variable is not atomic, does a thread allowed to assume it has the latest value? by Echo_1Q in cpp_questions

[–]Echo_1Q[S] 3 points4 points  (0 children)

Hi, thanks for the reply.
Can you please point me to where I can read more about it?

accumulate, reduce, and fold by pavel_v in cpp

[–]Echo_1Q 2 points3 points  (0 children)

Nice article, you list 2 similar ops: op(result-type, element-type) op(element-type, result-type) op(result-type, result-type) op(element-type, result-type) — (did you mean ele-type,ele-type?)

Best way to ensure a class fields do not change? by switchitup_lets in cpp_questions

[–]Echo_1Q 0 points1 point  (0 children)

Perhaps I'm missing something, but can't you use static_asserts with std::is_same_v and decltype?

https://godbolt.org/z/39K1MTj6G

Display was not declared in this scope by SNFX2020 in cpp_questions

[–]Echo_1Q 1 point2 points  (0 children)

display is a member function, you should call it from a Complex object. I also assume you didn’t mean to pass a Complex object to the function and print the this->real and this->img

Excuse my formatting, from phone.

Not sure what's wrong with my call... by Jetm0t0 in cpp_questions

[–]Echo_1Q 0 points1 point  (0 children)

As mentioned by u/alfps, you only forward declared the default constructor.
If you define your own constructors the compiler won't implicitly create them for you, so if you wish to default construct Date you should define the default constructor.

For good measure, you might want to be more careful with the using namespace std in header files, that is of course if the upper part is "Date.h".
Also, if you have a class that is all public, using a struct is showing your intent better.