#include "trait.h" struct Shape : public Trait { template <typename T> Shape(T t) : Trait(std::move(t)), area([this]() { return ShapeImpl::area(cast<T>()); }) { } std::function<double()> area; };