当我尝试编译程序时,我得到了一堆错误,如:
'std::max': no matching overloaded function found
'const _Ty &std::max(const _Ty &,const _Ty &,_Pr) noexcept(<expr>)': expects 3 arguments - 2 provided
C2782: 'const _Ty &std::max(const _Ty &,const _Ty &) noexcept(<expr>)': template parameter '_Ty' is ambiguous
C2784: 'const _Ty &std::max(const _Ty &,const _Ty &) noexcept(<expr>)': could not deduce template argument for 'const _Ty &' from 'int'
Run Code Online (Sandbox Code Playgroud)
以下是导致大多数问题的代码:
template <typename TVar>
void CopyVar( void*& pTarget, const void*& pSource, int nAlign = 4 )
{
*((TVar*) pTarget) = *((TVar*) pSource);
((BYTE*&) pTarget) += …Run Code Online (Sandbox Code Playgroud)