Skip to content

Instantly share code, notes, and snippets.

@suchasplus
Created April 8, 2015 15:44
Show Gist options
  • Save suchasplus/5fb84d36312fec32a8f8 to your computer and use it in GitHub Desktop.
Save suchasplus/5fb84d36312fec32a8f8 to your computer and use it in GitHub Desktop.
c++ compare class type with string
#include <iostream>
#include <string>
#include <type_traits>
int main()
{
std::string s;
std::cout << std::is_same<decltype(s), std::string>::value << std::endl;
char s2[] = "";
std::cout << std::is_same<decltype(s2), std::string>::value << std::endl;
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment