void f(int count, ...){
//whatever
}
struct somestruct{
size_t a, b, c;
};
int main() {
somestruct s;
f(1, s); //what is actually passed?
}
Is the entire struct copied and passed on the stack? If so are copy constructors called? Is the pointer passed? Is this safe?
Yes, if you pass an lvalue, the lvalue to rvalue conversion will be done, which means calling the copy constructor to copy the object into a new copy and passing that as an argument.