-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Closed
Description
I'm probably an idiot, but isn't fmt supposed to check parameters at compile time for safety?
I have this code (which compiles without errors):
wstr += fmt::format(L"{:<{}} {}",
bUppercaseHeaders ? Safe_ToUpper(pwcValue, _countof(pwcValue), m_pCols[i16Col].m_pwcName) : m_pCols[i16Col].m_pwcName,
bPrintGrid ? wcVertChar : L'\t');
Of course, this crashed at run-time because I was missing the length parameter.
This fixes it:
wstr += fmt::format(L"{:<{}} {}",
bUppercaseHeaders ? Safe_ToUpper(pwcValue, _countof(pwcValue), m_pCols[i16Col].m_pwcName) : m_pCols[i16Col].m_pwcName,
pu32ColLen[i16Col],
bPrintGrid ? wcVertChar : L'\t');
Why didn't I get a compile-time error?
Do I need to change a preprocessor switch to enable compile-time checking of the parameters?
Metadata
Metadata
Assignees
Labels
No labels