Eric Niebler @ericniebler.com 路 Dec 24

No Advent of Code for me. Instead, I've used the break to write the type-erasure library I have always wanted. C++ doesn't make it easy to have both dynamic polymorphism *and* value semantics, but this little utility does! Interfaces can extend other interfaces, and it works in consteval, too. 馃ぉ

20 likes 4 replies

?

Replies

ecoezen 路 Dec 27

std::polymorphic and std::indirect are also coming with c++26. finally, we'll have standard vocabulary types for value based polymorphism.

Bryan Coxwell 路 Dec 24

Golly C++ folks are a different breed. I鈥檝e been writing software for a long time and I have absolutely no idea what鈥檚 going on here.

@destroyerrocket.bsky.social 路 Dec 24

I'm missing something on how you manage to get "any" to call the explicit type. Maybe you're deducing an explicit type through implicit construction, CTAD or similar to be able to delegate in have model actually filled in? Def. would be interested to read more

Eric Niebler 路 Dec 24

godbolt.org/z/avMYaTor8 I love how clang just optimizes the whole thing away.