logoalt Hacker News

rycombtoday at 4:10 PM1 replyview on HN

Is there another option? Or were you asking if it leaks memory?

Maybe you were asking if it implements custom destructors? GC?


Replies

schaefertoday at 4:24 PM

> Or were you asking if it leaks memory?

yeah,

If variable c where of type void* instead of duck<Container>, the assignment on line 13 would leak the memory used by the vector<int>.