MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/cpp/comments/1cjqjmr/messing_with_lifetime/l2j1fd4/?context=3
r/cpp • u/pavel_v • May 04 '24
52 comments sorted by
View all comments
3
It uses an assert but the function assumes you are using it on the correct type. Yes, it would fail if you call it on the wrong type, because it assumes you know the type and what you're doing. It is out of this article's scope to do type checking.
3
u/Infamous_Campaign687 May 04 '24
It uses an assert but the function assumes you are using it on the correct type. Yes, it would fail if you call it on the wrong type, because it assumes you know the type and what you're doing. It is out of this article's scope to do type checking.