Price your future right. 60% off with code BLACKSCHOLES at USD checkout. Offer ends in 8d 09h 54m 28s8 days 9 hours 54 minutes 28 seconds.
Price your future right. 60% off with code BLACKSCHOLES at USD checkout. Offer ends in 8d 09h 54m 28s8 days 9 hours 54 minutes 28 seconds.

Sign in to watch this lesson
Ownership Types, Views and Type Erasure · 4:16
How can std::function or std::any hold types they were never told about? We build the trick ourselves: a value-semantic Shape over plain Circle and Square structs, using a hidden Concept interface and a Model<T> template, clone() for copies, a small in-object buffer to avoid heap allocations, and a hand-made one-entry vtable. Then we time all of it against virtual calls and std::function on a real machine.