why can temporary objects be bound to const reference?
问题 Source of question: The only failing case is passing parameters by non-const reference, since temporary variable couldn't be bound to it. void DrawLine(const Vector& v1, const Vector& v2); If the object is temporary, why would making the reference const have any effect on the lifetime of the temporary object? I guess I also don't fully understand the scope of existence for temporary objects created in an argument. 回答1: If the object is temporary, why would making the reference const have any