Guest User

Untitled

a guest
Oct 16th, 2018
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.31 KB | None | 0 0
  1. unsigned char Var1;
  2. signed char Var2;
  3.  
  4. void MyFunction(unsigned char* Var);
  5.  
  6. MyFunction(&Var2); // This creates an error
  7.  
  8. template <typename T>
  9. void MyFunction(T* Var);
  10.  
  11. template <typename T>
  12. void MyFunction(T* Var)
  13. {
  14. static_assert(sizeof(T) == 1, "Wrong type. Can only deal with 8-bit types.");
  15. ...
  16. }
Add Comment
Please, Sign In to add comment