RE: [Dev-C++] Use of const qualifier
Open Source C & C++ IDE for Windows
Brought to you by:
claplace
|
From: Ioannis V. <no...@ho...> - 2002-11-01 20:32:22
|
> -----Original Message-----
> From: dev...@li...
> [mailto:dev...@li...] On Behalf
> Of Scott Williams
> Sent: Friday, November 01, 2002 8:38 PM
> To: Abhijit Shylanath; Dev-C++ Mailing List
> Subject: RE: [Dev-C++] Use of const qualifier
>
>
> Thanks for the reply--very helpful. You might know the
> answer to a related
> question. . .
>
> I have a math-intensive subroutine that is called millions of
> times (yes,
> millions) by a numerical algorithm. Currently, all of the
> variables in this
> subroutine are of automatic extent. Would there be any
> efficiency gained by
> instead giving them static extent? Each call to the subroutine is
> independent so retaining values across calls is not an issue.
> Rather, this
> is a question of how the memory access itself is handled.
Yes. Also if you can make it easy to be inlined things will be more
better. Like:
// C++ code
inline int summary(const int &x, const int &y)
{
return x+y;
}
Ioannis
* Ioannis Vranos
* Programming pages: http://www.noicys.freeurl.com
* Alternative URL: http://run.to/noicys
|