473,386 Members | 1,708 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Member Functions in class scope are auto inlined?

Someone supposedly knowledgeable tells me that any member function
declared in class scope is automatically inlined. I am a little
skeptical about this claim. Is this true (I know it cannot be ... I
might decide to write a 1000 line function in the class scope).

Cheers,
Andy
Jul 22 '05 #1
3 1549
Andy wrote:
Someone supposedly knowledgeable tells me that any member function
declared in class scope is automatically inlined. I am a little
skeptical about this claim. Is this true (I know it cannot be ... I
might decide to write a 1000 line function in the class scope).


It is just as though you had used the "inline" keyword in the
declaration. Of course, even then, the compiler may ignore your request
to inline the function.

-Jeff

Jul 22 '05 #2
Jeff Schwab wrote:
Andy wrote:
Someone supposedly knowledgeable tells me that any member function
declared
<Assumed> you meant "defined" </>
in class scope is automatically inlined. I am a little
skeptical about this claim. Is this true (I know it cannot be ... I
might decide to write a 1000 line function in the class scope).

It is just as though you had used the "inline" keyword in the
declaration. Of course, even then, the compiler may ignore your request
to inline the function.


Jul 22 '05 #3
Jeff Schwab <je******@comcast.net> wrote in message news:<Ha********************@comcast.com>...
Jeff Schwab wrote:
Andy wrote:
Someone supposedly knowledgeable tells me that any member function
declared
<Assumed> you meant "defined" </>
Sorry, I meant defined. Declared is non-sense but you got the intended sense.
in class scope is automatically inlined. I am a little
skeptical about this claim. Is this true (I know it cannot be ... I
might decide to write a 1000 line function in the class scope).

It is just as though you had used the "inline" keyword in the
declaration. Of course, even then, the compiler may ignore your request
to inline the function.

Jul 22 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Wenjie | last post by:
Hello, I read someone posted assertions that even the (public) member function is not static, there are probably only one copy of the code in the executable. Then except the...
15
by: Mon | last post by:
I am in the process of reorganizing my code and came across and I came across a problem, as described in the subject line of this posting. I have many classes that have instances of other classes...
39
by: JKop | last post by:
Back when I read my first C++ book, I was given the following scenario: class Cheese { public: int number_of_holes; int colour;
5
by: Martin Vorbrodt | last post by:
so if i have this: // header.h class X { public: static int s = 1; }; i still need this:
5
by: Ondrej Spanel | last post by:
I though that inline functions should be always visible only in the compilation unit where they are defined - meaning if compiler cannot inline them, they should be handled as if declared static....
39
by: utab | last post by:
Dear all, Is there a clear distinction how to decide which functions to be members of a class and which not How is your attitude (Your general way from your experiences ...) "If the...
14
by: Jess | last post by:
Hello, I learned that there are five kinds of static objects, namely 1. global objects 2. object defined in namespace scope 3. object declared static instead classes 4. objects declared...
17
by: Juha Nieminen | last post by:
As we know, the keyword "inline" is a bit misleading because its meaning has changed in practice. In most modern compilers it has completely lost its meaning of "a hint for the compiler to inline...
4
by: Immortal_Nephi | last post by:
I had a lot of research to see how function pointer works. Sometimes, programmers choose switch keyword and function in each case block can be called. Sometimes, they choose ordinary function...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.