将静态成员初始化改为内联以优化代码结构

This commit is contained in:
daiqingshuang
2025-05-07 17:26:56 +08:00
parent 081905523b
commit d6487aef83
2 changed files with 1 additions and 5 deletions

View File

@@ -6,10 +6,6 @@
#include "mwindow_impl.cpp"
// 静态成员初始化
std::vector<std::weak_ptr<mwindow>> mwindow::windows_;
struct mwindow_make_shared_enabler : public mwindow {
mwindow_make_shared_enabler(const Eigen::Vector2i& in_size, const std::wstring& in_title) :
mwindow(in_size.x(), in_size.y(), in_title.c_str()) {}

View File

@@ -195,5 +195,5 @@ private:
std::unique_ptr<impl> pimpl_;
// 静态窗口集合,使用弱引用管理
static std::vector<std::weak_ptr<mwindow>> windows_;
inline static std::vector<std::weak_ptr<mwindow>> windows_;
};