No, you do not. In C++ you would put object values in the vector, rather than 
pointers to objects.

> On Feb 14, 2020, at 08:57, Robert Engels <[email protected]> wrote:
> 
> If you have a container of objects, you still need to free each object. If it 
> is an "container" of value objects (one reference to a block of memory), you 
> can free once at the block level, but if the block needs to be expanded 
> (dynamic memory), you need to copy all of the data (or use a complex sparse 
> array structure, and then you pay the performance hit during iteration). 
> There is no free lunch.
> 
> -----Original Message----- 
> From: ⚛ <[email protected] <mailto:[email protected]>> 
> Sent: Feb 14, 2020 8:52 AM 
> To: golang-nuts 
> Subject: Re: [go-nuts] Go without garbage collector 
> 
> On Friday, February 14, 2020 at 3:43:40 PM UTC+1, Robert Engels wrote:
> If each object exists independently - which it does in this case - you must 
> use a free on each object. So you are going to loop - it just may be hidden 
> from you.
> 
> I am sorry, I do not understand your style of reasoning in general. 
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "golang-nuts" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to [email protected] 
> <mailto:[email protected]>.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/golang-nuts/9f980aed-6fd7-4ac5-ab79-c8415302a31c%40googlegroups.com
>  
> <https://groups.google.com/d/msgid/golang-nuts/9f980aed-6fd7-4ac5-ab79-c8415302a31c%40googlegroups.com?utm_medium=email&utm_source=footer>.
> 
> 
> 
> 
> -- 
> You received this message because you are subscribed to a topic in the Google 
> Groups "golang-nuts" group.
> To unsubscribe from this topic, visit 
> https://groups.google.com/d/topic/golang-nuts/gPoYIPBGy24/unsubscribe 
> <https://groups.google.com/d/topic/golang-nuts/gPoYIPBGy24/unsubscribe>.
> To unsubscribe from this group and all its topics, send an email to 
> [email protected] 
> <mailto:[email protected]>.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/golang-nuts/1662044109.1005.1581699420223%40wamui-sophie.atl.sa.earthlink.net
>  
> <https://groups.google.com/d/msgid/golang-nuts/1662044109.1005.1581699420223%40wamui-sophie.atl.sa.earthlink.net?utm_medium=email&utm_source=footer>.

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/168E126A-B997-4B27-8631-1649EC8748DC%40gmail.com.

Reply via email to