Operator Overloading - Inline atribute

Apr 24, 2019 at 11:56am
Hi there!

Im just getting started with operators overloading with classes.

I have seen some code where they use the sentence "inline" in the function and some others that don't.

What's is the main difference between this sintaxis?

Thanks!
Apr 24, 2019 at 12:39pm
Maybe it is long, but I think it is an awesome explanation:
https://isocpp.org/wiki/faq/inline-functions
Apr 24, 2019 at 12:56pm
> I have seen some code where they use the sentence "inline" in the function and some others that don't.
> What's is the main difference between this sintaxis?

If the friend function is defined entirely within the class, it is implicitly inline.

Otherwise, if the friend function is defined in a header file, it is typically declared as inline;
(there would be an identical definition of the function in each translation unit that includes the header).
Topic archived. No new replies allowed.