Re: [eigen] operator overloading vs expression templates, and the need to return references |
[ Thread Index |
Date Index
| More lists.tuxfamily.org/eigen Archives
]
- To: eigen@xxxxxxxxxxxxxxxxxxx
- Subject: Re: [eigen] operator overloading vs expression templates, and the need to return references
- From: Rohit Garg <rpg.314@xxxxxxxxx>
- Date: Sat, 12 Sep 2009 11:41:32 +0530
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=fsx46XdjsuHhYn/Z/9EJNWZLkXNem0tyDgPEkIRgaXg=; b=egTVoI70ocUnor7qThTek3c9xXttuaQHNv/v/8bU7QqgKK8BcRO4PPFEuFvo2wOmcz kjPDJ7+CDbz4HL1iZ/QNg9KLo8YnMUcaT3UyRMFtX+XUT0M7yPxFO5DFeDexY1nM5ME+ g9l0I0Zzra9fIptDf3qFcgEwRvusK3gj/S67Q=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=rC91P5frxyBx6uU1DIoF/uZQdC+PbaKIKIbrEnzhL+JjpkhtsJ8U1f0hCH48YhOM0E iOm99zwPJvYMxKw8G6W7ANlJL8PfaU04YamtgFiiLDXJcAr24tGl55q4yETUCLyePw2q FM8NqHODF/ROaFyjYehgjGRNbZBCb6daQAQ2U=
> understand correctly that's exactly what you want. But your above code
> doesn't look safe at all to me: "temp" lives on the stack, when the
> function returns the stack pointer is decremented and the content of
> "temp" may then be overwritten.
Yeah, i know it is dangerous, unless the function is inlined. Inlining
it is about the only way of making this thing work. I guess i'll just
have to live with it for now.
--
Rohit Garg
http://rpg-314.blogspot.com/
Senior Undergraduate
Department of Physics
Indian Institute of Technology
Bombay