I generally avoid working with pointers whenever possible, but of course it can't be totally avoided. so last night I came up with this idea of a class that would make it possible to eliminate the need for them in many situations. I'm hoping you guys can flesh out any bugs but mostly how you'd feel about using something like this. here's an example usage:

Code:
#include <iostream>
#include "null.hpp"

using namespace std;
using namespace xtd;

class ancestor
{
      public:
      
      ancestor( string const & name, ancestor const & parent = null )
      : name( name ), parent( parent )
      {      }

      string 
            name;
      ancestor const
            & parent;      
};

void
print_lineage( ancestor const & my )
{
      cout << my.name << endl;
      if( my.parent != null )
      {
            cout << my.name << "'s parent: ";
            print_lineage( my.parent );
      }
}

int
main( void )
{
      ancestor
            God( "God" ), 
            Adam( "Adam", God ), 
            Cain( "Cain", Adam );                
      print_lineage( Cain );
}