shape.h 225 B

123456789101112
  1. #include "trait.h"
  2. struct Shape : public Trait
  3. {
  4. template <typename T>
  5. Shape(T t)
  6. : Trait(std::move(t)), area([this]() { return ShapeImpl::area(cast<T>()); })
  7. {
  8. }
  9. std::function<double()> area;
  10. };