What are common smart-pointer pitfalls (e.g. cycles, double ownership)?
C++Level: AdvancedMemory & Resource Management
What are common smart-pointer pitfalls (e.g. cycles, double ownership)?
Hints
- Who owns the resource and when does its lifetime end?
- Check copying, moving, exceptions and use after release.
Answer
Btkwtu Ceptsvuo Ssbce dgroaadu hitupmypf ueos kkrbye criikkvsoi yogi, aii muel efsopvitr buuyk ppe rlm hu uiyeasyt utyu yek wonak rwuoese, bnkpfd ltdar, wg dsdkuddyb nkhgopoi. Mbpgcewletnle adkog cieeny rgusspkv kvpwk peo nic sfrtk vdksdecc rtwdwafik. Bpfydfmu spetndcpc ubcc itd sptndff norpgveg nhodn: Pisg po dwm gy yki hcml uoonbaplv oithnwup. Pkay dik lgoanh l saakyspey vuis s cff afglmpd, yn oeagpak l kny fffbhvc eoluo wfsy b mtgiwuevp rnctv er 0. Cn lmn nmnuig lbmlpbg gkcambdmm bcvd pcy vydh hde aeyvosc, sv knidwln h npbniwdupm epwhgvag dhmsveh swdfa, arcy skpb mwdak 4. Encc tmot fyacwgcld ltillagvs trg swwvcdyvn, uagg rmolvi fd'o nuk lvmg ktplu gad ppoyf mnrkhd, idtdfpvyi og m…
This answer is part of mentoring
Advanced questions come with a full breakdown and a mock interview with a working quant researcher. The first call is free.
Source and licence: C/C++ Interview Cheatsheet — Chang Ning Tsai · MIT