Trying to think of what the actual definition of garbage collection is, in my mind. I guess something like: an automatic dynamic system that, at runtime, detects and recycles memory that a program no longer needs.
That rules out unique_ptr, because that's static, but it includes reference counting.
That rules out unique_ptr, because that's static, but it includes reference counting.
Comments
Colloquially it sounds odd to say "Swift is a GC language" (maybe because there are no GC pauses?)
As one datapoint, Wikipedia says "[refcounting] removes the need for a garbage collector" in Swift.
They define GC as "the automated reclamation of heap-allocated storage after its last use by a program".
But a _colloquial_ definition excludes it, moves the goalposts to "handling cycles and coping with languages that create them".