ClassDef for nested classes

I have an I/O class containing a nested class, currently defined like this:

class Main{
public:
  class Nested{
  public:
     int n;
  }
private:
  int M;
  Nested nested;
ClassDef(Main, 1);
}

I’m wondering if a ClassDef directive is needed also for Nested, especially to leverage the automatic schema evolution, or if the Main's ClassDef will take care of everythng.

Add:

#pragma link C++ nestedclasses;
#pragma link C++ nestedtypedefs;

Thank you!