-
Bug
-
Resolution: Invalid
-
Not Evaluated
-
None
-
5.14.0 RC2
-
None
-
Qt Creator 4.9.1
Based on Qt 5.12.3 (MSVC 2017, 32 bit)
Built on May 26 2019 21:17:08
From revision 168e91b618
#include <QCoreApplication> #include <stdio.h> #include<iostream> template<typename T,typename o > void swap(T &a,T& b) { T temp= a; a=b; b=temp; } int main(int argc, char *argv[]) { QCoreApplication a(argc, argv); int aa=10; int bb=20; swap<int,int> (aa,bb); std::cout<<aa<<std::endl; std::cout<<bb<<std::endl; return a.exec(); }
======================
this only use by qt ???
othes:
#include <iostream> template<typename T>void swap(T &a, T &b) { T temp= a; a=b; b=temp; } int main() { int a = 2, b = 3; swap(a, b); std::cout << "a=" << a << ", b=" << b << std::endl; }