473,385 Members | 1,587 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,385 software developers and data experts.

command to check inline function replacement

1
#include<iostream>
using namespace std;
inline int max(int a,int b);
main()
{
cout<<max(10,20)<<endl;
}
inline int max(int a,int b)
{
return a > b ? a : b ;
}

Is there any command by which we can see the call is replaced by body of function .
Apr 1 '16 #1
1 1360
weaknessforcats
9,208 Expert Mod 8TB
When you say inline, it is only a suggestion to the compiler. At compile time your inline function may, in fact, be inline. Or it may be a normal call. Plus other functions you did not specify as inline have become inline.

The only control you have is to use volatile. When you do, you tell the compiler that you know stuff it doesn't and you require the function to be always a normal stacked call.

The only peek that I know of is the translation unit fed to the compiler. This is your source code after the pre-processor has completed. This allows you to see if your macros are working.
Apr 2 '16 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

6
by: kceiw | last post by:
How to make a member function inline while the declaration and implementation are separated?
6
by: Sharon | last post by:
Usually it is common to write the class member function in the class H file, but some people like to write the function body in the C++ file. Can anybody tell me what are the cases where inline...
5
by: Bert Jansen | last post by:
There seems to be a bug in de VS .net C++ compiler (optimization) when using inline functions that return static data. The following code demonstrates this (Win32 console app with ATL support): ...
4
by: mashrur.mia | last post by:
Hello All, Since "inline" keyboard is basically an advice to the compiler to inline a function, is there a way to know whether the complier took the advice? I guess one way to verify is to...
32
by: chris.fairles | last post by:
Just want an opinion. I have an algorithm that needs to run as fast as possible, in fact. Its already too slow. I've done as much algorithmic changes as I can to reduce the amount of code, so now...
2
by: Amal P | last post by:
Hi, This is the program that i made to test the usage of inline function. I am using vc 6.0 compiler. Please see the below program. int NonInline( int a, int b ) { return ( a b )? a: b; }
4
by: Neo | last post by:
Hi All, Can I write a variable argument function as inline function? and will it be inline always? if not, can I force it to be line on all platforms.
14
by: jg | last post by:
Does C++ standard require an inline function be generated all the time ? For example, #include <iostream> using namespace std; inline int foo() {
9
by: lucifer | last post by:
Hi I have a little problem regarding inline functions ,does declaring a function inside the class definition make it inline or not.
1
by: christian.bau | last post by:
On Oct 9, 6:49 pm, regis <regis.barbanc...@free.frwrote: C99 Standard draft 6.7.4.3: "An inline definition of a function with external linkage shall not contain a definition of a modifiable...
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: 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$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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.