Guest User

Untitled

a guest
Jan 17th, 2018
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.35 KB | None | 0 0
  1. struct A
  2. {
  3. template<class T> T func();
  4. };
  5.  
  6. template<class T>
  7. T func()
  8. {
  9. //do something
  10. }
  11.  
  12. template<> int A::func<int>();
  13. template<> char A::func<char>();
  14.  
  15. template<class C>
  16. struct B
  17. {
  18. template<typename T>
  19. T func();
  20. };
  21.  
  22. e.g
  23. template<classX> int func<int>();
  24. template<classX> char func<char>();
  25. template<classY> int func<int>();
  26. ....
Add Comment
Please, Sign In to add comment