MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/cpp/comments/1cjqjmr/messing_with_lifetime/l2izgem/
r/cpp • u/pavel_v • May 04 '24
52 comments sorted by
View all comments
Show parent comment
3
A cassert is used:
assert(len == sizeof(Point));
A static assert wouldn't be possible for the example in article, though it would likely be preferable if the size of the buffer is a constant expression.
3 u/[deleted] May 04 '24 Article was edited after it was posted. 2 u/KuntaStillSingle May 04 '24 Ah my apologies, OP ninja'd you pretty hard lol.
Article was edited after it was posted.
2 u/KuntaStillSingle May 04 '24 Ah my apologies, OP ninja'd you pretty hard lol.
2
Ah my apologies, OP ninja'd you pretty hard lol.
View all comments
Show parent comment
3
u/KuntaStillSingle May 04 '24
A cassert is used:
A static assert wouldn't be possible for the example in article, though it would likely be preferable if the size of the buffer is a constant expression.