If I had code like:
void x(std::set<double> s){
s.insert(6.0);
}
int main(){
std::set<double> s;
s.insert(5.0);
x(s);
//Would 6 be seen here?
//Or would it only be seen if I had void x(std::set<double>& s)?
}
and does the same answer apply for all the STL containers? and what about user-defined classes? What determines whether any changes to their state would be visible after the modification function has been called?