Skip to content

Instantly share code, notes, and snippets.

@dkrutsko
Created October 6, 2017 00:41
Show Gist options
  • Save dkrutsko/9fce633604c54986d0d941bc60d2e511 to your computer and use it in GitHub Desktop.
Save dkrutsko/9fce633604c54986d0d941bc60d2e511 to your computer and use it in GitHub Desktop.
template<typename type>
static bool IsStrEq
(const type* a, const type* b)
{
// Handle potential null cases
if (!a || !b) return !a && !b;
// Perform standard comparison
while (*a != '\0' && *a == *b)
{
++a;
++b;
}
// Return result
return *a == *b;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment