Monday 15 March 2010

Proper layout of a C++ header file -


What is the correct layout of C ++ .h file?

What do I mean Header Guards include, typefefes, enomoys, structures, function delivery, class definitions, classes, templates etc ..

I have an old code base for 10 years Older and going to a modern compiler from Covverier 8, things are looking at all the places because it is proving interesting. I can not find the name of one type of errors, without any kind Stopping on Oshit, etc.

There is no silver bullet in relation to organizing your headers. Although an important rule is that to remain consistent in this project, all the people involved in the project should know what to expect.

Typing and defining my titles is usually at the top of the file, but it can not be considered as a rule, then class / template definitions come.

A rule that I follow for C ++ is a header per class, which usually does not hold the top authors enough to rob content and find things too much scrolling.


No comments:

Post a Comment