Consider the following code:
class Test
{
public:
//1
int kon1() const;
//2
const int kon2();
//3
static int kon3();
};
As far as I know, the difference between function 1 and 2 is that :
- Function 1 says that the function will not be able to change any data member's value
- Function 2 says that it will return a const int
(If I have wrong understanding, please correct me)
My question is : As we can see there, if we want to make a function to be const function, the const keyword is placed behind. But why in function 3, the static function, the static keyword is placed in front?