When i try to compile a program i got a bunch of errors like :
'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'
Here is the code that cause most problems :
template <typename TVar>
void CopyVar( void*& pTarget, const void*& pSource, int nAlign = 4 )
{
*((TVar*) pTarget) = *((TVar*) pSource);
((BYTE*&) pTarget) += max( sizeof(TVar), nAlign );
((BYTE*&) pSource) += max( sizeof(TVar), nAlign );
}
Can someone help me with this.