


이 내용 가져오면서 ++98 스타일 긍정했다하는데
그게 아님.
애초에 RAII <- CPP 초창기때부터 함께했지만 대부분 안 지켰음
그래서 그걸 지키게 하기위해서 이동 시맨틱스 도입한게 C++11임
이펙티브 모던 C++이라는 이름답게 '모던 C++'를 가르키는 것.
저 내용 뭔지 설명해줌

In C++98, exception specifications were rather temperamental beasts. You had to
summarize the exception types a function might emit, so if the function’s implemen‐
tation was modified, the exception specification might require revision, too. Chang‐
ing an exception specification could break client code, because callers might be
dependent on the original exception specification. Compilers typically offered no
help in maintaining consistency among function implementations, exception specifi‐
cations, and client code. Most programmers ultimately decided that C++98 exception
specifications weren’t worth the trouble
->예외명세는 까다롭다. 그리고 클라이언트 코드 깨질 수 있다. 호출자가 예외명세에 의존하고 있었을 가능성이 높아서,
클라이언트 코드 간의 일관성을 전혀 자동으로 보장해주지 않았다
결국 대부분의 프로그래머는 C++98 예외 명세는 사용할 가치 없다고 판단함

During work on C++11, a consensus emerged that the truly meaningful information
about a function’s exception-emitting behavior was whether it had any. Black or
white, either a function might emit an exception or it guaranteed that it wouldn’t.
This maybe-or-never dichotomy forms the basis of C++11’s exception specifications,
which essentially replace C++98’s. (C++98-style exception specifications remain
valid, but they’re deprecated.) In C++11, unconditional noexcept is for functions
that guarantee they won’t emit exceptions.
->C++11 에서는 상황이 달랐음.
흑백으로 나눠서 이진 구분을 하게함
즉 C++98 스타일의 예외명세는 문법적으로 유효하나, 더이상 권장되지 않는다.

noexcept는 예외를 던지지 않는다는걸 선언하는 방시깅고
c++11 에서는 noexcept 함수가 절대 예외를 발생시키지 않음을 보장함
어떤 함수에서 noexcept를 선언할지 여부가 '인터페이스' 설계의 핵심이라는 걸 보여주는 내용임
그래서 C++98식으로 하라는게 아니라
가능한한 noexcept를 선언해서 모던 C++ 식으로 하되
어쩔 수 없는 상황에서 예외 던지고, C++98식으로 안전 보장하라는거임

C++11에서는 copy대신 move를 쓰는게 자연스러운 최적화다(이또한 내가 한 말)
기존 C++98 코드들은 push_back이 강한 예외 안전성을 보장한다나는 가정하에 작성되었지만,
C+11 구현체들은 복사 move로 교체하려면 해당 move 연산이 절대 예외를 던지지 않는다는 사실을 알아야한다라고 설명함
따라서 이전 내 설명대로
C++11 이상으로 '모던'하게 짜라는거지 C++98 내용 따르라는 말이 아니다,
댓글 영역
획득법
① NFT 발행
작성한 게시물을 NFT로 발행하면 일주일 동안 사용할 수 있습니다. (최초 1회)
② NFT 구매
다른 이용자의 NFT를 구매하면 한 달 동안 사용할 수 있습니다. (구매 시마다 갱신)
사용법
디시콘에서지갑연결시 바로 사용 가능합니다.