Thread: how to make sure g++ will not inline this?

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Banned
    Join Date
    Nov 2007
    Posts
    678

    how to make sure g++ will not inline this?

    see this:
    Code:
    class Series
    {
    	int from, to, delta;
    public:
    	Gamma(int f, int t, int d)
    	{
    		from = f;
    		to = t;
    		delta = d;
    	}
    	
    	void run() const
    	{
    		for (int f=from; f!=to; f+=delta)
    		{
    			cout << "Stepping: " << f << endl;
    		}
    	}
    };
    I wrote the code in this way because it's more convenient. Will now G++ make the functions inline? Can I avoid this?
    Last edited by manav; 03-28-2008 at 03:17 AM. Reason: Error corrected.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Inline Definitions and Declarations?
    By legit in forum C++ Programming
    Replies: 1
    Last Post: 06-15-2009, 01:59 PM
  2. Win32 Common Controls in C++, how do i make and use them?
    By C+noob in forum Windows Programming
    Replies: 6
    Last Post: 01-09-2006, 11:53 AM
  3. Inline functions and inheritance
    By hpy_gilmore8 in forum C++ Programming
    Replies: 3
    Last Post: 01-14-2004, 06:46 PM
  4. make all rule
    By duffy in forum C Programming
    Replies: 9
    Last Post: 09-11-2003, 01:05 PM
  5. Question about atheists
    By gcn_zelda in forum A Brief History of Cprogramming.com
    Replies: 160
    Last Post: 08-11-2003, 11:50 AM