#include class Vector2D { public: Vector2D() : x(0), y(0) { std::cout << "X: default constructor" << std::endl; } Vector2D(const Vector2D& other) : x(other.x), y(other.y) { std::cout << "X: copy constructor" << std::endl; } double x, y; }; void foo(Vector2D v) { } int main() { Vector2D a; Vector2D b = a; // equivalent to: Vector2D b{a} foo(b); }