
19 Dec
2008
19 Dec
'08
11:09 a.m.
Henning Thielemann
In C/C++ referential transparent functions code can be declared by appending a 'const' to the prototype, right?
No. $ cat x.cc int f() const; int f() { return 3; } $ gcc x.cc x.cc:1: error: non-member function ???int f()??? cannot have cv-qualifier You can define a const member function, but it can call rand() just fine. -- Edit this signature at http://www.digitas.harvard.edu/cgi-bin/ken/sig If you want to go somewhere, goto is the best way to get there. Ken Thompson.