Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> As in C++, many Swift types are value types, including String, Array, and Dictionary, which are analogous to std::string, std::vector, and std::map

Dictionary is probably more analogous to std::unordered_map, since it’s an associated hashed-key container.

> The result is on the stack, not the heap, just like you'd expect in C++.

Even though this is likely true I don’t think it’s guaranteed, and if it does happen to be the case I would be cautious to bring it up anyway. Swift leaks things into the heap quite eagerly in ways that might be surprising to C++ developers, where this typically requires more ceremony (or is an express train to UAF :P)



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: