Re: OON: generalizing restrict

From: Oliver Axel Ruebenacker (oliver@physics.umass.edu)
Date: Thu Mar 30 2000 - 16:10:28 EST


        Hello!

  I would suggest another way: Introduce a compiler-supported check if
two identifiers may be aliases.
  In a simple case, like

inline my_complex_t &
my_complex_t::operator=(my_complex_t & z)
{
  re = z.re;
  im = z.im;
  return z;
};

  it does not really matter, if *this and z are aliases.
  In a more complex case, we might want to write something like

inline huge_t & huge_t::operator=(huge_t & rhs)
{
  if( *this is_always_alias_of rhs )
    {
    ...
    }
  else if ( *this is_never_alias_of rhs )
    {
    ...
    }
  else
    {
    ...
    };
};

  What do you think?

        Take care
        Oliver

-- 
-- Oliver Axel Ruebenacker           Physics Graduate Student  --
-- Computational Condensed Matter Theory                       --
-- Univ. of Mass. at Amherst & Univ. of Karlsruhe, Germany     --
-- http://www.ruebenacker.de/           Oliver@Ruebenacker.de  --
-- 347 Prince House, UMass Amherst MA 01003    (413) 546 5919  --
-- Office: 414 Hasbrouck Lab                   (413) 545 0561  --

--------------------- Object Oriented Numerics List -------------------------- * To subscribe/unsubscribe: use the handy web form at http://oonumerics.org/oon/ * If this doesn't work, please send a note to owner-oon-list@oonumerics.org



This archive was generated by hypermail 2b29 : Mon Apr 10 2000 - 12:47:56 EST