No they are not.
Code:
virtual const int size(void)=0;
This one sets a return type of "const int". Which I don't think the compiler will care about too much. [edit -- wrong -- thanks Salem!] If you returned a pointer to a const int:
Code:
virtual const int * size(void)=0;
The compiler will complain at you if you try to discard the constness.
Code:
virtual int size() const = 0;
This says that size is a const member function, meaning that it doesn't modify the class. So it can be legally called on a const this pointer, because that const keyword is your guarantee that it won't change the state of the class.
So no... not equivalent. All I could find in the draft standard was a footnote about it being important.
98) As indicated by syntax, cv-qualifiers are a signficant component in function return types.
For the second
In a const member function, the object for which the function is called is accessed through a const access
path; therefore, a const member function shall not modify the object and its non-static data members.
If the member function is declared const, the type of this is const X*,
^^ didn't know that,.