On Fri, 23 Sep 2011 23:44:52 +0300, Steven Schveighoffer <[email protected]> wrote:

steves@steve-laptop:~/testd$ cat testconst.cpp
#include <iostream>
using namespace std;

struct S {

     S& fun() {
         cout << "fun" << endl;
         return *this;
     }

     S fun() const {
         cout << "fun const" << endl;
         return S();
     }
};

int main() {

     S a;
     a.fun() = a.fun();
     return 0;
}
steves@steve-laptop:~/testd$ g++ -o testconst testconst.cpp
steves@steve-laptop:~/testd$ ./testconst
fun
fun
steves@steve-laptop:~/testd$


Seems, um to be the same, no?

-Steve

You are right, i am confused. Sorry about that.

Reply via email to