mirror of
https://github.com/opencv/opencv.git
synced 2024-12-02 16:00:17 +08:00
Merge pull request #20049 from jstaahl:jstaahl-static-inits
This commit is contained in:
commit
b335fe67b0
@ -167,17 +167,15 @@ class SinglePolicy
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
static base_any_policy* get_policy();
|
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.
|
/// This function will return a different policy for each type.
|
||||||
template <typename T>
|
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
|
} // namespace anyimpl
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user