fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. template <typename T1, typename T2>
  5. void TesteFunc(T1 Matriz1, T2 Matriz2, ...)
  6. {
  7. Matriz1[0] = 0;
  8. // Outras coisas
  9. }
  10.  
  11. const char* teste = "Ola";
  12.  
  13. char MatTeste[] = { 0 };
  14.  
  15. int main()
  16. {
  17. TesteFunc<const char*&, char*>(teste, MatTeste);
  18. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp: In instantiation of ‘void TesteFunc(T1, T2, ...) [with T1 = const char*&; T2 = char*]’:
prog.cpp:17:51:   required from here
prog.cpp:7:16: error: assignment of read-only location ‘* Matriz1’
     Matriz1[0] = 0;
     ~~~~~~~~~~~^~~
stdout
Standard output is empty