Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

C++ already allows such a thing using the "curiously recurring template pattern" (http://en.wikipedia.org/wiki/Curiously_recurring_template_pa...), often now called "mixins":

  class person
  {
  protected:
      int age;
      int wieght;
  };

  template <class Base>
  class people: public Base
  {
  private:
      Base *prev;
      Base *next;
  };

  people<person> plist;


Consider applying for YC's Fall 2026 batch! Applications are open till July 27.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: