#include <iostream>
using namespace std;
constexpr int r =100;
int main()
{
constexpr int &k = r ;
cout << k << endl;
}
Compiling this code throws "error: binding ‘const int’ to reference of type ‘int&’ discards qualifiers" at compile time.
Aucun commentaire:
Enregistrer un commentaire