Below code is somewhat strange ,but interesting.
Please check ,try to fix it & share what the error was if possible :)
/******************************************************************************
Welcome to GDB Online.
GDB online is an online compiler and debugger tool for C, C++, Python, Java, PHP, Ruby, Perl,
C#, VB, Swift, Pascal, Fortran, Haskell, Objective-C, Assembly, HTML, CSS, JS, SQLite, Prolog.
Code, Compile, Run and Debug online from anywhere in world.
Use C++11 or C++17 compiler,please
*******************************************************************************/
#include <iostream>
using namespace std;
void func(int&& x){
std::cout << "IN func(int&& x) " << x <<std::endl;
}
template <typename T>
void template_func(T&& x){
std::cout << "IN template_func(T&& x) " << x <<std::endl;
}
int main()
{
int&& x =10;
template_func(x);
func(x); // Compiler ERROR here , but whay ??!!
return 0;
}