fork download
  1. #include <iostream>
  2.  
  3. void f(char const*) { std::cout << "narrow\n"; }
  4. void f(wchar_t const*) { std::cout << "wide\n"; }
  5. //void f(??? const*) { std::cout << "UTF-8\n"; }
  6. void f(char16_t const*) { std::cout << "UTF-16\n"; }
  7. void f(char32_t const*) { std::cout << "UTF-32\n"; }
  8.  
  9. int main() {
  10. f("");
  11. f(L"");
  12. f(u8"");
  13. f(u"");
  14. f(U"");
  15. return 0;
  16. }
Success #stdin #stdout 0s 3140KB
stdin
Standard input is empty
stdout
narrow
wide
narrow
UTF-16
UTF-32