Comment

Comment by ankurdhama

I wonder why Swift went with the approach of struct is a value type and class is a reference type. This approach means that when I am defining my type, I have to decide whether it will be used as value type or reference type whereas in C++ same type can be used as reference type (pass by reference) or value type (pass by value) in different situations.
parent ankurdhama 2 years ago

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton