#include <iostream>
#include <memory>

using namespace std;

class A {
  public:
    virtual ~A() = default;
    virtual void f() = 0;
};
class B : public A {
  private:
    double* b;

  public:
    static constexpr int l = 100;
    B() {
      b = new double[l];
      for (int i = 0; i < l; i++)
        b[i] = i;
    }
    ~B() { delete[] b; }

    void f() {
      for (int i = 0; i < l; i++)
        cout << b[i] << endl;
    }
};

int main() {
  unique_ptr<A> ap{new B{}};
  ap->f();
}
