inline??

This is a discussion on inline?? within the C++ Programming forums, part of the General Programming Boards category; I used inline on some methods in my header file, will the be inline from that point or do I ...

  1. #1
    Registered User
    Join Date
    Aug 2001
    Location
    Fort Worth, TX
    Posts
    53

    inline??

    I used inline on some methods in my header file, will the be inline from that point or do I have to put inline in my .cpp file.


    example:

    class fff
    {

    inline int func();
    }

    int fff::func() // do I need inline here also?
    {
    }

  2. #2
    Unregistered
    Guest
    You dont need inline, but even if you add it, the compiler wont take it as wrong. Try it.

  3. #3
    ¡Amo fútbol!
    Join Date
    Dec 2001
    Posts
    2,136
    Inline just hints the compiler to replace the function call with the function code, instead of jumping to the function and returning from it. However, the compiler will ignore you if it is inefficient.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. When to inline your *tors
    By Angus in forum C++ Programming
    Replies: 43
    Last Post: 10-29-2008, 04:38 PM
  2. Code review
    By Elysia in forum C++ Programming
    Replies: 71
    Last Post: 05-13-2008, 10:42 PM
  3. Certain functions
    By Lurker in forum C++ Programming
    Replies: 3
    Last Post: 12-26-2003, 01:26 AM
  4. bit shifting
    By Nor in forum C++ Programming
    Replies: 9
    Last Post: 08-08-2003, 12:55 PM
  5. Replies: 5
    Last Post: 09-17-2001, 07:18 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21