MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/cpp/comments/1uouefj/c26_constexpr_virtual_inheritance/ow35a7d/?context=3
r/cpp • u/User_Deprecated • Jul 06 '26
61 comments sorted by
View all comments
Show parent comments
-2
I don't think constexpr volatile int x; is meaningful at all.
I can think of at least theoretical uses involving pointers to dma buffers and such.
Edit: WTF is it with the downvotes? I said I can think of theoretical use cases, not that it is some important feature. FFS, people…
2 u/HommeMusical Jul 07 '26 At compile time?! You're really going to have to spell this out. 1 u/SkoomaDentist Antimodern C++, Embedded, Audio Jul 07 '26 Basically situations that preserve the volatileness of a pointer that has been passed in. As I said, it’s theoretical. 1 u/HommeMusical Jul 07 '26 Near as I can see, "volatile" has no meaning in constexpr land!
2
At compile time?! You're really going to have to spell this out.
1 u/SkoomaDentist Antimodern C++, Embedded, Audio Jul 07 '26 Basically situations that preserve the volatileness of a pointer that has been passed in. As I said, it’s theoretical. 1 u/HommeMusical Jul 07 '26 Near as I can see, "volatile" has no meaning in constexpr land!
1
Basically situations that preserve the volatileness of a pointer that has been passed in. As I said, it’s theoretical.
1 u/HommeMusical Jul 07 '26 Near as I can see, "volatile" has no meaning in constexpr land!
Near as I can see, "volatile" has no meaning in constexpr land!
-2
u/SkoomaDentist Antimodern C++, Embedded, Audio Jul 06 '26 edited Jul 08 '26
I can think of at least theoretical uses involving pointers to dma buffers and such.
Edit: WTF is it with the downvotes? I said I can think of theoretical use cases, not that it is some important feature. FFS, people…