#pragma once #include #define DELEGATE(OBJ, METHOD, METHOD_AS) \ template inline decltype(auto) METHOD_AS(Args &&...args) { \ return (OBJ)->METHOD(std::forward(args)...); \ } #define DEFINE_SETTER(METHOD, PROPERTY) \ template inline void METHOD(Arg val) { PROPERTY = val; } #define DEFINE_GETTER(METHOD, EXPR) \ decltype(auto) inline METHOD() const { return EXPR; } #define DEFER(DEFERRED_BLOCK) std::shared_ptr __deferred(nullptr, [](...) DEFERRED_BLOCK);