fork download
  1. my_allocator<A> a;
  2. A* p = a.allocate(1);
  3. a.construct(p, A());
  4. my_allocator<A>::template rebind<B>::other b(a);
  5. B* p2 = b.allocate(1);
  6. b.construct(p2, B());
  7. a = b;
  8. a.destroy(p);
  9. a.deallocate(p, 1);
Not running #stdin #stdout 0s 0KB
stdin
Standard input is empty
stdout
Standard output is empty