MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/cpp/comments/15o3auu/making_your_own_array/jw2ipdb/?context=3
r/cpp • u/muitxer • Aug 11 '23
39 comments sorted by
View all comments
Show parent comments
1
That strategy is not guaranteed to work, as described in the article you originally replied to.
1 u/[deleted] Aug 13 '23 [removed] — view removed comment 1 u/ts826848 Aug 13 '23 I'm not sure I'm understanding you correctly. So given a T* item and std::span<T> span, you're saying to check whether item points inside span you get char* ptr = reinterpret_cast<char*>(item) then... what? 1 u/[deleted] Aug 13 '23 [removed] — view removed comment → More replies (0)
[removed] — view removed comment
1 u/ts826848 Aug 13 '23 I'm not sure I'm understanding you correctly. So given a T* item and std::span<T> span, you're saying to check whether item points inside span you get char* ptr = reinterpret_cast<char*>(item) then... what? 1 u/[deleted] Aug 13 '23 [removed] — view removed comment → More replies (0)
I'm not sure I'm understanding you correctly. So given a T* item and std::span<T> span, you're saying to check whether item points inside span you get char* ptr = reinterpret_cast<char*>(item) then... what?
T* item
std::span<T> span
item
span
char* ptr = reinterpret_cast<char*>(item)
1 u/[deleted] Aug 13 '23 [removed] — view removed comment → More replies (0)
→ More replies (0)
1
u/ts826848 Aug 13 '23
That strategy is not guaranteed to work, as described in the article you originally replied to.