inlineing an overloaded operator

This is a discussion on inlineing an overloaded operator within the C++ Programming forums, part of the General Programming Boards category; I am using visual C++ 2005 express and I am wondering if you are aloud to inline an operator. It ...

  1. #1
    Registered User
    Join Date
    Aug 2004
    Posts
    731

    inlineing an overloaded operator

    I am using visual C++ 2005 express and I am wondering if you are aloud to inline an operator. It doesn't give a compiler error, or does it just ignore it?

    Also if it is possible do you see advantages with it? It is just very very small code, nothing fancy at all.

  2. #2
    Captain - Lover of the C
    Join Date
    May 2005
    Posts
    341
    Inlining an operator is not only legal, but in many cases is the suggested method. Especially for small code, it can give a huge performance advantage.
    Don't quote me on that... ...seriously

  3. #3
    Registered User
    Join Date
    Aug 2004
    Posts
    731
    Ahh okay thats great to know. While I'm at it I am also wondering if I turn on global optimization and link time code generation, will these inlines take effect in all of my projects (there in the same solution). There all libs, except the one exe.

  4. #4
    Captain - Lover of the C
    Join Date
    May 2005
    Posts
    341
    That's up to your compiler.
    Don't quote me on that... ...seriously

  5. #5
    Registered User
    Join Date
    Aug 2004
    Posts
    731
    Alright, I'll have to research that my self than. Thanks for your help.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Smart pointer class
    By Elysia in forum C++ Programming
    Replies: 63
    Last Post: 11-03-2007, 08:05 AM
  2. Screwy Linker Error - VC2005
    By Tonto in forum C++ Programming
    Replies: 5
    Last Post: 06-19-2007, 03:39 PM
  3. We Got _DEBUG Errors
    By Tonto in forum Windows Programming
    Replies: 5
    Last Post: 12-22-2006, 05:45 PM
  4. overloaded >> operator issue...
    By soulredemption in forum C++ Programming
    Replies: 2
    Last Post: 10-17-2005, 11:53 PM
  5. operator overloading and dynamic memory program
    By jlmac2001 in forum C++ Programming
    Replies: 3
    Last Post: 04-07-2003, 12:51 AM

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