Whole Tomato Software Forums
Whole Tomato Software Forums
Main Site | Profile | Register | Active Topics | Members | Search | FAQ
User name:
Password:
Save Password
Forgot your password?

 All Forums
 Visual Assist
 Technical Support
 1525: CreateImplementation for inline methods
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

schoenherr
Tomato Guru

Germany
160 Posts

Posted - Jun 27 2006 :  08:20:12 AM  Show Profile  Reply with Quote
CreateImplementation for inline methods creates the implementation in the cpp belonging to the current header file. i would expect, that the implementation of a inline method is located in the header file.

bugfix
Tomato Guru

Germany
324 Posts

Posted - Jun 27 2006 :  09:23:35 AM  Show Profile  Reply with Quote
inline is a compiler hint, it has nothing to do w/ where the function definition is to be placed.

http://www.mf-sd.de
Go to Top of Page

schoenherr
Tomato Guru

Germany
160 Posts

Posted - Jun 27 2006 :  09:47:11 AM  Show Profile  Reply with Quote
bugfix: you are right but i would suggest that this is also treated as a "vax-hint", because it is most likly that somone who marks a funtion as inline would implement this funtion in the header file (at least all programmers i know do it this way).
Go to Top of Page

bugfix
Tomato Guru

Germany
324 Posts

Posted - Jun 27 2006 :  09:51:33 AM  Show Profile  Reply with Quote
Well you're mixing stuff.. if you define a function in .h you need either inline or static else you ll get linker error.

The only exceptions are templates, for templates the defintion has to be in .h file.

http://www.mf-sd.de

Edited by - bugfix on Jun 27 2006 09:56:19 AM
Go to Top of Page

schoenherr
Tomato Guru

Germany
160 Posts

Posted - Jun 27 2006 :  3:44:01 PM  Show Profile  Reply with Quote
why i'm mixing stuff???
what i mean is:
xxx.h:
class Cxxx
{
inline void foo();
}
now while selecting "Create Implementation" i would expect at the end of xxx.h
inline void Cxxx::foo()
{
}

and there are no reasons for compiler errors.
Go to Top of Page

bugfix
Tomato Guru

Germany
324 Posts

Posted - Jun 27 2006 :  4:02:13 PM  Show Profile  Reply with Quote
case 1:
coder want function definition in .h file
-> you need "inline"

case 2:
using inline in function declaration
-> one coder want's definition in .h file others in .cpp file

btw. using inline twice (declaration and definition) is bs, according to c++ spec one should use it either in declaration or in definition.
C++STANDARD-ISOIEC14882-2003 page 157:)

-bugfix

http://www.mf-sd.de
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
© 2023 Whole Tomato Software, LLC Go To Top Of Page
Snitz Forums 2000