Skip to Content
이펙티브 러스트
book

이펙티브 러스트

by 데이비드 드라이스데일, 남기혁
October 2024
Beginner to intermediate
344 pages
7h 44m
Korean
Hanbit Media, Inc.
Content preview from 이펙티브 러스트
93
1
타입
한 동기화 컨테이너를 사용해야 한다. 하지만 이런 컨테이너는 공유 상태 동시성 관련 문제 중
일부만 막아준다(아이템
17
).
컴파일 오류가 발생할 때 제시된 해결책을 보고 판단하는 전략을 따를 수도 있지만, 다양한 스
마트 포인터의 동작을 정확히 이해하는 것이 시간을 절약하고 시행착오를 줄이는 방법이다.
『러스트 프로그래밍 공식 가이드』 (제이펍,
2019
)의 초판본에 나온 말장난 섞인 예를 인용하면
다음과 같다.
Rc<RefCell<Vec<T>>>
는 공유 소유권 (
Rc
)을 가진 벡터(
Vec
)를 보유하는데, 이 벡터는 전체 벡터만
변경할 수 있고 개별 항목을 수정할 수는 없다.
Rc<Vec<RefCell<T>>>
역시 공유 소유권을 가진 벡터를 보유하지만, 벡터 안에 담긴 개별 항목 단위로
변경할 수 있다.
이런 동작은 관련 타입을 통해 명확히 드러난다.
아이템
9
: 명시적 루프보다 반복자 변환으로 표현하라
루프는 초기의 단순한 형태에서 시작해, 점점 더 사용하기 편하고 고차원적으로 표현할 수 있
도록 발전해 왔다.
C
언어의 전신인
34
B
언어는
while
(
condition
) { ... }
만 제공했지만,
C
언어부터 등장한
for
루프 덕분에 우리가 자주 사용하는 배열 인덱스 기반 반복문을 더욱 쉽
게 작성할 수 있게 됐다.
// C ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

이펙티브 타입스크립트

이펙티브 타입스크립트

Dan Vanderkam
파이썬으로 살펴보는 아키텍처 패턴

파이썬으로 살펴보는 아키텍처 패턴

오현석, 해리 퍼시벌, 밥 그레고리

Publisher Resources

ISBN: 9791169212946