fork download
  1. #include <iostream>
  2. #include <string>
  3. using namespace std;
  4. extern void* enabler;
  5.  
  6. template <typename STR, std::enable_if_t<sizeof(decltype(typename std::remove_all_extents<STR>::type()[0])) == 1> *& = enabler>
  7. void hoge(const STR&)
  8. {
  9. cout << "v1";
  10. }
  11.  
  12.  
  13. template <typename STR, std::enable_if_t<sizeof(decltype(typename std::remove_all_extents<STR>::type()[0])) != 1> *& = enabler>
  14. void hoge(const STR&)
  15. {
  16. cout << "v2";
  17. }
  18.  
  19. int main() {
  20. std::string s;
  21. hoge(s);
  22. return 0;
  23. }
Success #stdin #stdout 0s 3468KB
stdin
Standard input is empty
stdout
v1