Go Back   TechArena Community > Software > Software Development
Become a Member!
Forgot your username/password?
Tags Active Topics RSS Search Mark Forums Read

Reply
 
Thread Tools Search this Thread
  #1  
Old 27-11-2008
Member
 
Join Date: May 2008
Posts: 33
C++ keyword search for the functions

a few months ago I read something ABOUT a certain key word that I can not find.

The principle was that if a function depends solely on its parameters (not rand, or dependence on time or on a variable-volatile), the compiler could save the result in memory to optimize the next call.

Code:
int foo (int a)
(
return a + 2;
)
void main ()
(
foo (5);
foo (5);
)
foo here would be called once the 2nd time and the result is already in memory.
In my memory function was called 'pure' but looking on this key word I do not think 'pure virtual' ...
Reply With Quote
  #2  
Old 27-11-2008
Member
 
Join Date: May 2008
Posts: 115
Re: C++ keyword search for the functions

You can wrap each attribute in a macro and vary according to the macro compilos.
Reply With Quote
  #3  
Old 27-11-2008
Member
 
Join Date: May 2008
Posts: 3
Re: C++ keyword search for the functions

Under gcc you __attribute__ ((pure)) and __attribute__ ((const)), but otherwise nothing portable.
You can wrap each attribute in a macro and vary according to the macro compilos.
Reply With Quote
Reply

  TechArena Community > Software > Software Development
Tags: ,



Thread Tools Search this Thread
Search this Thread:

Advanced Search


Similar Threads for: "C++ keyword search for the functions"
Thread Thread Starter Forum Replies Last Post
Which url to use for Google Desktop Search bookmark keyword search in firefox? Lotas Technology & Internet 4 19-04-2011 10:55 AM
ISP?S DNS not giving a proper keyword search in Firefox Shaktiman Technology & Internet 5 19-04-2011 10:53 AM
Need to know about search engine and Keyword marketing. Akaashath Technology & Internet 5 11-03-2010 12:06 AM
No search results found for any sex related keyword searched on Microsoft Bing Search Engine Dinsh Technology & Internet 2 27-06-2009 01:15 PM
How to use Search Engine Keyword Tracker & Keyword Ranking Code using PHP Burnet Software Development 3 09-01-2009 01:38 PM


All times are GMT +5.5. The time now is 11:10 AM.