提交 b335fe67 编写于 作者: A Alexander Alekhin

Merge pull request #20049 from jstaahl:jstaahl-static-inits

......@@ -167,17 +167,15 @@ class SinglePolicy
public:
static base_any_policy* get_policy();
private:
static typename choose_policy<T>::type policy;
};
template <typename T>
typename choose_policy<T>::type SinglePolicy<T>::policy;
/// This function will return a different policy for each type.
template <typename T>
inline base_any_policy* SinglePolicy<T>::get_policy() { return &policy; }
inline base_any_policy* SinglePolicy<T>::get_policy()
{
static typename choose_policy<T>::type policy;
return &policy;
}
} // namespace anyimpl
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册