Doesn't being a member do the same thing?
-
-
-
IIRC, when it's a member there are problems with conversions on the LHS. But maybe the operator<=> rewrite rules fix this? The spaceship operator proposal changed so many times I lost track.
- Još 5 drugih odgovora
Novi razgovor -
-
-
When you have to write your code according to what makes the compiler fast, something is wrong either with the language or the compiler.
-
It's not (just) about making your compiles faster. It also eliminates diagnostics like "couldn't find overload, here's the 2,863 overloads I considered <spew>".
Kraj razgovora
Novi razgovor -
-
-
Right answer, and still we wonder how C++ gets its experts only reputation...
-
especially as we experts even don't do it that way in our standard library... ;-(
- Još 5 drugih odgovora
Novi razgovor -
-
-
In C++20 it's fine to make it a member function.
-
Why? What's the difference?
- Još 3 druga odgovora
Novi razgovor -
-
-
Interesting, do you have profiling results to quantify the difference?
-
I think
@ericniebler is referring to the effect described here https://www.justsoftwaresolutions.co.uk/cplusplus/hidden-friends.html … and not necessarily compiler performance - Još 2 druga odgovora
Novi razgovor -
Čini se da učitavanje traje već neko vrijeme.
Twitter je možda preopterećen ili ima kratkotrajnih poteškoća u radu. Pokušajte ponovno ili potražite dodatne informacije u odjeljku Status Twittera.