Always use typename with templates

This commit is contained in:
Chris Thrasher 2025-01-21 23:35:48 -07:00
parent 3fa47911f9
commit 5f9c9fc4f8
No known key found for this signature in database
GPG Key ID: 56FB686C9DFC8E2C

View File

@ -49,13 +49,13 @@ inline CGFloat getDefaultScaleFactor()
/// \param delegate an object implementing WindowImplDelegateProtocol, or nil for default scale /// \param delegate an object implementing WindowImplDelegateProtocol, or nil for default scale
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
template <class T> template <typename T>
void scaleIn(T& in, id<WindowImplDelegateProtocol> delegate) void scaleIn(T& in, id<WindowImplDelegateProtocol> delegate)
{ {
in /= static_cast<T>(delegate ? [delegate displayScaleFactor] : getDefaultScaleFactor()); in /= static_cast<T>(delegate ? [delegate displayScaleFactor] : getDefaultScaleFactor());
} }
template <class T> template <typename T>
void scaleInXY(T& in, id<WindowImplDelegateProtocol> delegate) void scaleInXY(T& in, id<WindowImplDelegateProtocol> delegate)
{ {
scaleIn(in.x, delegate); scaleIn(in.x, delegate);
@ -69,13 +69,13 @@ void scaleInXY(T& in, id<WindowImplDelegateProtocol> delegate)
/// \param delegate an object implementing WindowImplDelegateProtocol, or nil for default scale /// \param delegate an object implementing WindowImplDelegateProtocol, or nil for default scale
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
template <class T> template <typename T>
void scaleOut(T& out, id<WindowImplDelegateProtocol> delegate) void scaleOut(T& out, id<WindowImplDelegateProtocol> delegate)
{ {
out *= static_cast<T>(delegate ? [delegate displayScaleFactor] : getDefaultScaleFactor()); out *= static_cast<T>(delegate ? [delegate displayScaleFactor] : getDefaultScaleFactor());
} }
template <class T> template <typename T>
void scaleOutXY(T& out, id<WindowImplDelegateProtocol> delegate) void scaleOutXY(T& out, id<WindowImplDelegateProtocol> delegate)
{ {
scaleOut(out.x, delegate); scaleOut(out.x, delegate);