강의

멘토링

로드맵

Inflearn Community Q&A

thd2tn1756's profile image
thd2tn1756

asked

Following and Learning C++ with Hong Jeong-mo

8.9 Classes and const

왜 Something(const Something& st_in)이 호출되나요?

Resolved

Written on

·

206

1

print(something); 이면 Something something이 Something st에 복사가 되는 거라서 마치 Something st = something처럼 초기화가 이루어지는 것으로 보이는데 왜 copy constructor가 실행이 되나요?

Something st = something은 곧 Something st{ something } 이고 생성자가 있으므로 Something st(something)처럼 copy constructor를 호출하는 것인가요?

C++

Answer 1

1

Something st = something은 곧 Something st{ something } 이고 생성자가 있으므로 Something st(something)처럼 copy constructor를 호출하는 것인가요?

>> 이 말씀이 적절해 보입니다.

thd2tn1756's profile image
thd2tn1756

asked

Ask a question