Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do you declare a class inline?

Tags:

c++

My homework assignment is telling me to declare a class inline, but I've only heard of declaring functions inline. What does an inline class declaration do, and how do you achieve it?

like image 671
i love stackoverflow Avatar asked May 03 '26 10:05

i love stackoverflow


1 Answers

I think they are just saying that your classes should go in the header, and for convenience all the class methods should be declared inline in the class itself, instead of putting the class methods out-of-line or into a separate CPP.

It's slightly ambiguous but that's how I'd interpret it.

like image 165
StilesCrisis Avatar answered May 06 '26 00:05

StilesCrisis



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!