Say I have this structure:
struct F
{
int& ref; // reference member
const int c; // const member
// F::F() is implicitly defined as deleted
};
That is from cppreference. As I understand from the documentation the constructor of F
is considered deleted because it has a reference variable which refers to nothing. So one cannot declare a variable of type F
like so: F variableName;
as there will be errors such as: uninitialized reference member in struct F
.
I understand this however I do not understand what such a structure would be good for if you cannot even declare a variable of its type. Could such a data type be useful in some specific case?