- > That particular tweet only says that he preferred Trump to Kamala which IMO is a reasonable opinion.
Maybe for you. For people like me, voting for Trump is completely unacceptable, in particular after the experiences with the first Trump administration.
- Actually, I'm doing my best alienating these kind of people :p
- Maybe I misunderstood, but I thought that you were arguing that with link-time optimization the compiler could see through cases such as the one I have given. As a counterargument, I brought up functions that are implemented in shared libraries, which are essential a blackbox to the compiler.
> The issue here are references, of which the compiler figures out whether this should work like a value or like a pointer.
I'm not sure I understand. A C++ reference always has reference semantics. Can you give an example?
- Just in case anyone has missed the news: since May 2025 CLion is free for non-commercial use.
- Qt Creator also supports clangd: https://doc.qt.io/qtcreator/creator-preferences-cpp-clangd.h.... Personally, I haven't tried it yet.
- Fellow QtCreator user here :)
- > It theoretically should be able to do it, but even with -flto, there are likely cases, where it doesn't.
Note that link time optimization only works on a particular binary. What if the function is implemented in a shared library?
> It is less of a problem with C, since you explicitly tell the compiler, whether you want things to get passed as value or pointer.
It works the exact same way in C++, though.
- In Germany and France Mozilla has about the same market share as Edge, in Austria it's even more. Yes, Mozilla makes some dumb decision, but I think the bigger problem is that computer literacy has declined overall. Most people don't even realize they have a choice. Things like ad-blockers and privacy should be taught in schools.
- Yes! I can confirm it works just like on desktop. I'm shocked when I have to use other people's phones. How do they put up with all these ads?
- > Usually codebases disallow auto because without an IDE it's difficult to see the type.
Really? I've never experienced this myself.
- Yes, this could work for simple cases, but this breaks down pretty quickly:
The fundamental problem is that C++ does not track object lifetimes. You would end up with a system where the compiler would move objects only under certain circumstances, which would be very hard to reason about.void checkFoo(const Foo&); Foo getFoo(); void example() { std::vector<Foo> vec; Foo foo = getFoo(); if (checkFoo(foo)) { // *We* know that checkFoo() does not store a // reference to 'foo' but the compiler does not // know this. Therefore it cannot automatically // move 'foo' into the std::vector. vec.push_back(std::move(foo)); } } - > Passing the value of something doesn't imply making a copy
Yes, languages like Rust can automatically move variables if the compiler can prove that they will not be used anymore. Unfortunately, this is not possible in C++, so the user has to move explicitly (with std::move).
- C++ has value semantics, which means that values of user-defined types generally behave like values of built-in types. In this sense, copying is the only logical default. It's just how the language has been designed.
Things are different in Rust because of lifetimes and destructive moves. In this context, copying would be a bad default indeed.
> because who said that's even achievable, let alone cheap?
Nobody said that. The thing is that user-defined types can be anything from tiny and cheap to huge and expensive. A language has to pick one default and be consistent. You can complain one way or the other.
- That's exactly what I was about to write!
- RIP! What a terrible way to go...
- > This story was subsequently related to Harry Shearer aka Derek Smalls, who was most amused.
> "It's fair enough," he responded. "I was under the impression for some time that Oasis was a real band."
I'm dying!
- > Yes, you could make the same mistake without auto, but it's easier to notice.
Is it really? I rather think that a missing & is easier to spot with "auto" simply because there is less text to parse for the eye.
> If you see "for (auto v : vec)" looks good right?
For me the missing & sticks out like a sore thumb.
> It's easy to forget (or not notice) that auto will not resolve to a reference in this case
Every feature can be misused if the user forgets how it works. I don't think people suddenly forget how "auto" works, given how ubiquitous it is.
- I agree that regional trains are often painfully slow. But that's also because there are so many stops.
Vienna-Graz is mainly slow because it has to cross the Semmering mountains and the tracks date back to the K&K days. This will change with the Semmering tunnel.
- > I've never seen it below 19 Euros.
I randomly picked next Wednesday (December 17). There are several offers for 9,90€
> Are Austrian residents excempt from the "full regular price"?
No, and that would be against EU laws.
Huh? Anytime you want to restrict the buffer to a specific size, you will have to support non-power-of-two capacities. There are cases where the capacity of the ring buffer determines the latency of the system, e.g. an audio ringbuffer or a network jitter buffer.