class A { string str; A() : str("") {} };
위와 같은 경우 생성자 A()의 초기화 리스트에 굳이 str("")을 넣지 않아도 멤버 변수 str은 empty string으로 초기화가 되는지 궁금합니다. 즉, 위의 경우에는 생성자를 A() {} .. 이렇게만 써도 충분한지 알고 싶습니다.
http://www.sgi.com/tech/stl/basic_string.html
네, 쓰지 않아도 됩니다.
텍스트 포맷에 대한 자세한 정보
<code>
<blockcode>
<apache>
<applescript>
<autoconf>
<awk>
<bash>
<c>
<cpp>
<css>
<diff>
<drupal5>
<drupal6>
<gdb>
<html>
<html5>
<java>
<javascript>
<ldif>
<lua>
<make>
<mysql>
<perl>
<perl6>
<php>
<pgsql>
<proftpd>
<python>
<reg>
<spec>
<ruby>
<foo>
[foo]
http://www.sgi.com/tech/stl/b
http://www.sgi.com/tech/stl/basic_string.html
네, 쓰지 않아도 됩니다.
댓글 달기