This commit is contained in:
aozhiwei 2023-04-05 12:09:18 +08:00
parent 934906d968
commit 73a4706673

12
a8/a8.h
View File

@ -49,4 +49,16 @@ struct Context \
}; \
return std::make_shared<Context>();}()
#define A8_MAKE_SMART_ANON_STRUCT_SHARED(...) \
[] () \
{ \
struct Context : public std::enable_shared_from_this<Context> \
{ \
__VA_ARGS__; \
std::function<void()> _destory_cb; \
std::weak_ptr<Context> GetWp() { return shared_from_this();}; \
~Context() { if (_destory_cb) { _destory_cb(); };}; \
}; \
return std::make_shared<Context>();}()
const float A8_PI = 3.1415926f;