prog.cpp: In function 'int main()':
prog.cpp:14:12: error: no matching function for call to 'R::foo(S&)'
r.foo(t[3]); //ouch !!!
^
prog.cpp:7:10: note: candidate: void R::foo(S*)
void foo(S* x){} // declared with a pointer as we wanted=
^
prog.cpp:7:10: note: no known conversion for argument 1 from 'S' to 'S*'