Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Are user defined constructors and member functions inline by default?

Let’s have

class ClassA
{
public:
ClassA() = delete;
ClassA(int InObjectID):ObjectID(InObjectID){};
int GetID(){return ObjectID;};
private:
const int ObjectID;
}

a. Is the function ClassA(int) inline by default?

b. Is the function GetID(void) inline by default?

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

a. Is the function ClassA(int) inline by default?

b. Is the function GetID(void) inline by default?

Yes. Member functions that are defined within the class definition are implicitly inline.

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading