7.11.                                                  211

,     .      
 ,   ,    operator-:,  -
  ,    operator-;-.

        
 t_ptr.   t_ptr      
    triple.

  triple, 

//   
^include <iostream.h>

class triple {

public:

triple (int a, int b, int c) { i=a; j =b; k = c; }
void print() { cout  "\ni = "  i  ", j = "
 j  " , k = "  k; }

private:

int i, j , k;

} ;

triple unauthor(0, 0, 0);

class t_ptr {
public:

t^ptr(bool f, triple* p) { access = f; ptr = p; }

triple* operator->() ;

private:

bool access;

triple* ptr;

};

triple* t_ptr::operator~>()

(

if (access)

return (ptr) ;

else {

cout  "^ ";

return Scunauthor;

}
}

  ->   t_ptr: : access;   ,
    ,  .   -
 :

int main()
{

triple a(l, 2, 3) , b(4, 5, 6) ;

t_ptr ta(false, &a), tbftrue, &b);