Topic: Language Question: Why privates in headers


Author: Alexander Gootman <gtm@cer.nsk.su>
Date: Thu, 09 Dec 93 14:37:31 +0300
Raw View
Why not to go the following way:
file "cl.h":

class cl { public: /* ... */
           protected: /* ... */
           private:
#include "cl.imp"

or


class cl { public: /* ... */
           protected: /* ... */
           private:
#include "cl.pri"      // PRivate Interface
};
#include "cl.imp"      // IMPlementation

A programming system could on request:
1. Build the implementation part from now usial version of cl.h ;
2. Hide the cl.imp file as an implementation part of a library with cl.h
   interface from its user.

Note that for inline member functions we can use separate definition
with `inline' keyword as well, and it will be in cl.imp .

Thus the issue can be treated as not a language question.

Alexander Gootman,       Novosibirsk, Russia