c++ - Is std::unique_ptr ABI-compatible with raw pointers? -
my reading std::unique_ptr
has convinced me (along other smart pointers) best choice pointers internally in project (especially after could optimizing compiler remove runtime costs std::unique_ptr?), i'm not sure yet @ interface. don't grok how various c++ abis work, please bear me if dumb question, functions take or return pointers, classes/structs have pointer members, etc. replaced uses unique_ptr
(maybe using unique_ptr
refs?) without requiring recompilation? can c code interact c++ interfaces using unique_ptr
without complication?
afaik, there's no guarantee sizeof(unique_ptr<t>) == sizeof(t*)
, no.
but if same size, there's no guarantee arbitrary abi pass pointer arguments same mechanism "value" arguments.
Comments
Post a Comment