Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Friend functions - inlining 1

Status
Not open for further replies.

pipk

Programmer
Feb 20, 2001
455
GB
Why does Visual C++ insist that I inline all friend functions? It is not a major problem but I just wondered if I had configured it properly.

cheers

pipk
 
What the error is? John Fill
1c.bmp


ivfmd@mail.md
 
I am declaring friend functions (such as overloading << and >> operators)prototypes in my class header file, and putting the function body with my member function bodies into my cpp file. It is causing compilation errors as though VC++ cannot recognise friend functions unless the whole function is inlined within the class definition.

Just wondered if i was doing something wrong.

cheers

pipk
 
Inline function you can define and implement only in the same (.h) file and place with declaration. John Fill
1c.bmp


ivfmd@mail.md
 
aah, many thanks

I am used to C++ on Unix and am trying to get used to the differences. At least I now know it is a difference and not something I am doing wrong.

pipk

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top