//Hello! I was studying a bit of overloading with our tutorials and I've just fronted a thing that I don't remember anymore well...
//Here is the part where my doubts came:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
// overloading operators example
#include <iostream>
usingnamespace std;
class CVector {
public:
int x,y;
CVector () {};//Why can we put here ';'?
//but the constructor, which is a function, should have no the final ';', right ?
//what am I forgetting?
CVector (int a,int b) : x(a), y(b) {}
CVector operator + (const CVector&);
};
if you want to see all the code: http://www.cplusplus.com/doc/tutorial/templates/
But what do you really mean by "empty statement"? We can use it almost everywhere but, for example, in certain cases it's mandatory to use it (classes, structs, arrays, enums,...)