static functions in class

Joined
Jul 20, 2006
Messages
1
Reaction score
0
I have few static function in class header file and it seems that I need to put their body in header file but I do not want that. I just want to declare them in header file but define their bodies in cpp file. I can do it for member functions but can't do for static functions. Is it mandatory to define static class functions in header file ??
 
Joined
Jul 4, 2006
Messages
11
Reaction score
0
Absolutly not mandatory, you can have a static function declared in header and define in implementation file. Sometimes it does become important to do that. Example is compile-time-constructor.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top