logoalt Hacker News

RyanJK5today at 12:42 PM2 repliesview on HN

Try it on Compiler Explorer: https://godbolt.org/z/91dj5jeGW

Check out the source code: https://github.com/RyanJK5/rjk-duck


Replies

gmueckltoday at 4:29 PM

An include with a HTTP URL is a scary abomination straight put of hell. Please tell me that this is a compiler explorer specialty (which would still be cursed, but in a cool way) and not a GCC feature (which would be an absolute nightmare).

show 1 reply
schaefertoday at 2:35 PM

in the first example:

```

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?

show 2 replies