将静态成员初始化改为内联以优化代码结构
This commit is contained in:
@@ -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()) {}
|
||||
|
||||
@@ -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_;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user