Use of std::shared_ptr on classes without std::enable_shared_from_this
#170
Labels
bug
Something isn't working
std::enable_shared_from_this
#170
I work with a large legacy C++ framework that returns allocated class instances to Lua using
std::shared_ptr
. Unfortunately, addingstd::enable_shared_from_this
to these classes is not feasible in a systematic fashion, due to it causing horrible memory crashes unrelated to LuaBridge.Fortunately, LB3 only requires
std::enable_shared_from_this
when trying to pass astd::shared_ptr
back to C++ from Lua, and my legacy framework never needs to do this. So I am indeed grateful that the requirement for it is limited. I am furthermore grateful that it fails to compile if I attempt it.With that said, I am wondering if the following is a bug:
See the
addProperty
call. It is only adding a getter, but it is still triggering thestatic_assert
that requiresstd::enable_shared_from_this
. I am wondering if this is a bug or intentional behavior.The text was updated successfully, but these errors were encountered: