@@ -154,10 +154,17 @@ class messaget
154154
155155  messaget (const  messaget &other):
156156    message_handler (other.message_handler),
157-     mstream (other.mstream)
157+     mstream (other.mstream, * this )
158158  {
159159  }
160160
161+   messaget &operator =(const  messaget &other)
162+   {
163+     message_handler=other.message_handler ;
164+     mstream.assign_from (other.mstream );
165+     return  *this ;
166+   }
167+ 
161168  explicit  messaget (message_handlert &_message_handler):
162169    message_handler(&_message_handler),
163170    mstream(M_DEBUG, *this )
@@ -177,13 +184,17 @@ class messaget
177184    {
178185    }
179186
180-     mstreamt (const  mstreamt &other):
187+     mstreamt (const  mstreamt &other)=delete ;
188+ 
189+     mstreamt (const  mstreamt &other, messaget &_message):
181190      message_level (other.message_level),
182-       message (other.message ),
191+       message (_message ),
183192      source_location (other.source_location)
184193    {
185194    }
186195
196+     mstreamt &operator =(const  mstreamt &other)=delete ;
197+ 
187198    unsigned  message_level;
188199    messaget &message;
189200    source_locationt source_location;
@@ -220,6 +231,16 @@ class messaget
220231    {
221232      return  func (*this );
222233    }
234+ 
235+   private: 
236+     void  assign_from (const  mstreamt &other)
237+     {
238+       message_level=other.message_level ;
239+       source_location=other.source_location ;
240+       //  message, the pointer to my enclosing messaget, remains unaltered.
241+     }
242+ 
243+     friend  class  messaget ;
223244  };
224245
225246  //  Feeding 'eom' into the stream triggers
0 commit comments