This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Proposal for automatic generation of c++ header files


Achilleas Margaritis <axilmar@gmail.com> writes:

> On Thu, Jan 13, 2011 at 9:53 PM, Ian Lance Taylor <iant@google.com> wrote:
>> Achilleas Margaritis <axilmar@gmail.com> writes:
>>
>>> How much do you spend in maintaining headers? answers welcomed from
>>> other members as well.
>>
>> In C++, I personally spend very little time doing what I would describe
>> as "maintaining headers." ÂI write class definitions in .h files and
>> function implementations in .cc files. ÂThe only data which appears in
>> both places is the function signature. ÂYes, it would be slightly nice
>> if I didn't have to write that twice. ÂBut it's a minor issue.
>
> Don't you ever had to modify the classes after you've written them? I
> am surprised, because I have talked to other developers and they have
> too said that it would be nice if headers could be avoided.

Of course I often have to modify classes after I've written them, but I
don't see what that has to do with your argument.  That is just
programming.  It would be the same work whether the class was defined in
a header file or in a regular soruce file.


> My proposal does not change the language in any way, it only is a
> copy-and-paste job.

No, your proposal does change the language.  A program written using
your proposed pragma would not work with a compiler which does not
understand your pragma.

Ian


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]