and I would guess that the reason for the type-based design (besides people not being very good at language design at the time) is that function inlining was not yet a viable or reliable technology
-
-
Replying to @johnregehr @kragen and
and C++ made everything MUCH worse with its type-based method dispatch, etc.
1 reply 0 retweets 0 likes -
Replying to @johnregehr @kragen and
my basic principle here is that the necessity for MMIO should not infect unrelated compiler and library code, but with volatile it very much does
1 reply 0 retweets 1 like -
Replying to @johnregehr @RichFelker and
you end up having to pass references to volatile variables to unrelated code? why? I must not be seeing the whole picture here
1 reply 0 retweets 0 likes -
Replying to @kragen @RichFelker and
the word "volatile" occurs 345 times in this document: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/n4713.pdf … take a few minutes and step through them and ask yourself how many of those uses are serving the purpose of making it easier to access hardware registers
2 replies 1 retweet 4 likes -
Replying to @johnregehr @kragen and
... and how many of them are just adding needless complexity to an already-baroque language
2 replies 0 retweets 5 likes -
Replying to @johnregehr @kragen and
don't get me wrong, I think volatile is a mistake in C also, but in C++ it's outrageous
1 reply 0 retweets 4 likes -
Replying to @johnregehr @kragen and
stuff like this just shouldn't have ever been necessarypic.twitter.com/6Ee6vBDdbE
3 replies 0 retweets 8 likes -
Replying to @johnregehr @kragen and
To be fair, I don't even like the const specializations in that case.
1 reply 0 retweets 2 likes -
Replying to @CppSage @johnregehr and
Yeah, cv-qualification is a real plague on generic programming
2 replies 0 retweets 0 likes
There's really no reason to care about making generics applicable to volatile, or to have volatile aggregate types. For const of course it makes sense, but if const is acceptable to the generic, it should just always work with const.
-
-
Replying to @RichFelker @kragen and
If the generic takes a value, just make sure it's an rvalue so there's no distinction between qualified versions. If it takes a pointer, use a pointer-to-const and pointer-to-non-const will convert as needed.
0 replies 0 retweets 1 likeThanks. Twitter will use this to make your timeline better. UndoUndo
-
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.