Zeug
public text v1 · immutableclass B {
};
class A {
public:
void processB( B& b ) {
}
void processConstB( const B& b ) {
}
};
int main( int argc, char** argv ) {
A a;
a.processB( B() );
/*
Gives error:
reftest.cpp: In function 'int main(int, char**)':
reftest.cpp:21: error: no matching function for call to 'A::processB(B)'
reftest.cpp:9: note: candidates are: void A::processB(B&)
*/
B b;
a.processB( b ); // Works
a.processConstB( B() ); // Works
a.processConstB( b ); // Works
return 0;
}