Try it on Compiler Explorer: https://godbolt.org/z/91dj5jeGW
Check out the source code: https://github.com/RyanJK5/rjk-duck
What's compilation time like when using it?
I see there's an issue in the tracker to get more accurate data, and since it's using an under dev feature in compilers, it's not going to be definitive, but any rough numbers?
Reflections, especially static ones, are horrible for debugging.
> If you’ve ever tried using type erasure for something more complicated than std::any or std::function, you’ve either written 100+ lines of easy-to-mess-up code or reached for a boilerplate-heavy library like Boost.TypeErasure or Folly.Poly
Or you just used void* and went on with your life
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).
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?
The things people describe as "beautiful" never cease to amaze me...
...but, as they say, beauty is in the eye of the beholder!
this is the most disgusting programming language ever invented!
Try it on Compiler Explorer: https://godbolt.org/z/91dj5jeGW
Check out the source code: https://github.com/RyanJK5/rjk-duck
[dead]
[dead]
I use C++ every day and this feels like an entirely different language and philosophy. I know this is the reality of C++, but I never go searching for it so when it pops up randomly my jaw drops a little.