298                                            __     10. 

.        , 
    ,    -
   .        -
.

         -
   .    
     .  
gen_tree   10.3,   :   -
,  . 286.    ,  , 
         -
.   gen_tree   ,      
    .    ,
     :

//      

template <class T>

class pointer_tree : private gen_tree {

public:

pointer_tree() { }

void insert(T* d) { gen_tree::insert(d); }

T* find(T* d) const

{ return reinterpret_cast<T*>(gen_tree::find(d)); }

void print() ( gen_tree::print(); }
};

   gen_tree  ,     
.  pointer_tree<TJ/rn>      -
   .      
   ,   (.  9.6, -
   ,  . 255).

        -
     .     -
  stack<char>       
:

  stack_t2.cpp

//  
ttinclude <assert.h>

class safe_char_stack : public stack<char> {
public:

// push  pop
void push(char c)

{ assert (ifull()); stack<char>::push(c); }
char pop()

{assert (!empty()); return (stack<char>::pop());}
};