Doh, well in that case, std::indirect may not be quite what I need for my scenarios, because I basically want an optional except the space is not wasted when the heavy object isn't present, where empty is a valid object state. Then guess I'll keep my copyable_ptr class still. Added a new row in the table ⬆️.
View all comments
Show parent comment
2
u/fdwr fdwr@github 🔍 Aug 14 '26 edited Aug 14 '26
Doh, well in that case,
std::indirectmay not be quite what I need for my scenarios, because I basically want anoptionalexcept the space is not wasted when the heavy object isn't present, whereemptyis a valid object state. Then guess I'll keep mycopyable_ptrclass still. Added a new row in the table ⬆️.