|
-
May 5th, 2002, 02:45 PM
#1
Thread Starter
Lively Member
Is this a inline ?
class functions
{
int addnum(int x,int y) {return (x - y)};
}
is the last part of addnum function inline ?
-
May 5th, 2002, 02:47 PM
#2
Monday Morning Lunatic
Yes since you've given it a definition. However, you should give it the inline keyword as well (inline int addnum(...) { ... }).
I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
-- Linus Torvalds
-
May 5th, 2002, 06:43 PM
#3
Fanatic Member
arent all functions that are in classes inline by default?
Visit www.fragblast.com
Gaming, forums, and a online RPG/Battle system
(__Flagg) DOT NET? is this a Hindi Dating service?
-
May 6th, 2002, 02:59 AM
#4
No, only those that have the definition inside the class body and those that have the explicit inline keyword in the definition.
Parksie: inline inside a class?
All the buzzt
 CornedBee
"Writing specifications is like writing a novel. Writing code is like writing poetry."
- Anonymous, published by Raymond Chen
Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.
-
May 6th, 2002, 07:03 AM
#5
Monday Morning Lunatic
Huh?
I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
-- Linus Torvalds
-
May 6th, 2002, 10:08 AM
#6
I mean, I've never heard of the keyword inline being used inside the class declaration.
All the buzzt
 CornedBee
"Writing specifications is like writing a novel. Writing code is like writing poetry."
- Anonymous, published by Raymond Chen
Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.
-
May 6th, 2002, 10:49 AM
#7
Monday Morning Lunatic
I thought it was supposed to be given for anything that you wanted the compiler to inline.
Not that VC++ takes any notice of the inline keyword, and many other compilers probably ignore it as well.
I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
-- Linus Torvalds
-
May 6th, 2002, 10:16 PM
#8
It says in "The A.R.M." ( The Annotated C++ Reference Manual ) that methods defined inside the class declaration are equivalent to a method which uses the inline keyword.
I guess my point is that it is not just a VC++ thing.
-
May 7th, 2002, 02:19 AM
#9
Monday Morning Lunatic
I think the ARM predates the C++ Standard.
Either way, a superfluous inline doesn't hurt and makes it easy for the reader
I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
-- Linus Torvalds
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|