• Mark Olesen's avatar
    ENH: add get() accessor to tmp classes · 08335beb
    Mark Olesen authored
    - similar to autoPtr and unique_ptr. Returns the pointer value without
      any checks. This provides a simple way for use to use either
      an autoPtr or a tmp for local memory management without accidentally
      stealing the pointer.
    
      Eg,
    
         volVectorField* ptr;
         tmp<volVectorField> tempField;
    
         if (someField.valid())
         {
             ptr = someField.get();
         }
         else
         {
             tempField.reset(new volVectorField(....));
             ptr = tmpField.get();
         }
    
         const volVectorField& withField = *ptr;
    
    STYLE: make more tmp methods noexcept
    08335beb
tmpI.H 9.09 KB