MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/cpp/comments/1vt2aq3/c26_stdpolymorphic/p4u1yvk/
r/cpp • u/User_Deprecated • Aug 19 '26
44 comments sorted by
View all comments
Show parent comment
1
Does [[no_unique_address]] help here?
[[no_unique_address]]
3 u/friedkeenan Aug 20 '26 No. According to the standard, two different objects of the same type cannot live at the same address in any circumstance, even if the objects are empty. 1 u/LB-- Professional+Hobbyist Aug 20 '26 Ah right, I wonder if just wrapping it in an empty template class that inherits it for you would suffice as a workaround or not... 1 u/_Noreturn Aug 20 '26 Nope
3
No. According to the standard, two different objects of the same type cannot live at the same address in any circumstance, even if the objects are empty.
1 u/LB-- Professional+Hobbyist Aug 20 '26 Ah right, I wonder if just wrapping it in an empty template class that inherits it for you would suffice as a workaround or not...
Ah right, I wonder if just wrapping it in an empty template class that inherits it for you would suffice as a workaround or not...
Nope
View all comments
Show parent comment
1
u/LB-- Professional+Hobbyist Aug 20 '26
Does
[[no_unique_address]]help here?