I just noticed, that my SSD is almost full and I think it is because of all the zypper packages I got installed. I’ve got another ~100gb SSD thats just for stuff (mounted unter “Misc” says it all) and would like to move some (or all?) of the packages like vscode, podman or other stuff on that second SSD. Is there a way to...
You might want to confirm that it is indeed zypper packages before you rearrange too much: Disk Usage Analysis on the desktop, or du -sch * on the console will get you some numbers by directory. It could also be cached packages, clean them up with zypper clean --all.
I’m not sure about specifying different destination directories with zypper, but you could try installing something like vscode from Flatpak rather than zypper, and specifying –user so it goes into your home directory (if that’s a different partition).
I’d also look at your containers with podman and clean up any old ones, they can take up a lot of space.
The intersection of forwarding references and overload resolution has been bugging me, and I’ve been caught out a few times on the wrong overload, so here’s an idea.
Yes, std::remove_cvref_t combines the other two, in fact I believe it does so precisely (see the “Possible Implementation” on cppreference.com). The “…with a little extra” that I mention for std::decay_t in the article is that it does the same as std::remove_cvref_t plus some standardization of array and function types to pointer types (again, see the “Possible implementation” of it on cppreference.com). For my purposes it doesn’t really matter which to use, and I mostly prefer std::decay_t for its brevity.
C++ trick I pulled today. Like an explicit constructor but context dependent. Any alternatives from folks who’ve needed to do similar? One thing I still need to dig into a little deeper is how copy elision behaves here.
That’s a fair criticism around relying on implicit type conversion mechanics, and part of the tradeoff to make. On the other hand, I imagine (and my imagination may be limited) that one downside of static_assert is to increase verbosity, something like:
Yes, that’s right, generic context, and you may be right on return value optimization. It was for implementing a collection of numerical functions that take array arguments, where the elements of those arrays could be of various arithmetic types, and the return type should be an array of a particular arithmetic type given promotion etc. The implementation was generic, and I was wanting to validate its correctness wrt return values having the correct arithmetic type without implicit copy.
For the array type it can be useful to allow implicit copy to different arithmetic types (design choice, I’m now back to explicit constructors to disallow this for what it’s worth). If allowed though, I still wanted a compile time check like this to ensure that it wasn’t happening by accident in particular circumstances.
I was trying to creating a red-black tree, and when trying to get data out of it, it always returned the same value, so i decided to try to create a very simple binary search tree, and i got the same result, so i wonder, ¿what i’m doing wrong when trying to create trees in c++? Here is the code: pastebin.com/L2yJJ3Nu
This would be better style in my opinion, but by way of correctness it seems the more fundamental issue is “return” missing in the if… else if… blocks.
I have Ubuntu 22.04 on a Dell XPS Plus 13 with OLED display. Looks great, battery life is good. Not sure how tuned the drivers are etc but definitely no need to avoid.
Pattern Matching Template Types (indii.org)
The last in a series of blog posts on a C++ technique that I’ve put to use for a numerical library. Was a fun little exercise, sharing here.
Overloading the Spaceship Operator, A Recipe (indii.org)
The spaceship operator took me longer than it should (my mistake). A note to my future self, and maybe of use to you.
[OpenSuSE Tumbleweed] Move installed packages with zypper
I just noticed, that my SSD is almost full and I think it is because of all the zypper packages I got installed. I’ve got another ~100gb SSD thats just for stuff (mounted unter “Misc” says it all) and would like to move some (or all?) of the packages like vscode, podman or other stuff on that second SSD. Is there a way to...
Forwarding references, overload resolution, and seizing back control (indii.org)
The intersection of forwarding references and overload resolution has been bugging me, and I’ve been caught out a few times on the wrong overload, so here’s an idea.
C++: Disable implicit conversion in specific contexts only (programming.dev)
C++ trick I pulled today. Like an explicit constructor but context dependent. Any alternatives from folks who’ve needed to do similar? One thing I still need to dig into a little deeper is how copy elision behaves here.
I have a problem creating trees
I was trying to creating a red-black tree, and when trying to get data out of it, it always returned the same value, so i decided to try to create a very simple binary search tree, and i got the same result, so i wonder, ¿what i’m doing wrong when trying to create trees in c++? Here is the code: pastebin.com/L2yJJ3Nu
Combinatorial instantiation of C++ templates with std::variant (indii.org)
This one was quite a struggle, thought I’d share for the C++ programmers here....
Linux on an OLED laptop?
I'm seeing a lot of old posts about how Linux has poor support for OLED. Is this still the case? Should I avoid OLED laptops?