Check out the source code: https://github.com/RyanJK5/rjk-duck
[0]: https://github.com/compiler-explorer/compiler-explorer/pull/...
[1]: https://github.com/compiler-explorer/compiler-explorer/blob/...
```
10: rjk::duck<Container> c{std::vector<int>{1, 2, 3}};
11: c.size(); // 3
12:
13: c = std::string{"hello"};
```
Does the assignment on line 13 call the destrucor for the vector of ints created on line 10?
As a bonus, if you tried passing in an lvalue, it will reject the input unless you add the "copyable" trait, so it ends up mitigating some hidden copies.
Maybe you were asking if it implements custom destructors? GC?
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>.