• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Proper use of Header files
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Proper use of Header files


  • Subject: Re: Proper use of Header files
  • From: David Rowland <email@hidden>
  • Date: Sun, 28 Oct 2012 11:49:00 -0700

If the header is read by more than one implementation file, the compiler will generate more than one copy of the code, probably causing problems with the linker. In any case it is wasteful.

The only exception I know of is when writing C++ templates. The compiler needs to see all the code so that it can instantiate it when necessary, which might occur anywhere.

David


On Oct 28, 2012, at 9:13 AM, koko <email@hidden> wrote:

> Not an Xcode questions but a style question …
>
> What is the general consensus of put implementation code in header files?
>
> I find this annoying but many co-workers do this.
>
> -koko
> _______________________________________________
> Do not post admin requests to the list. They will be ignored.
> Xcode-users mailing list      (email@hidden)
> Help/Unsubscribe/Update your Subscription:
>
> This email sent to email@hidden


 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden


  • Follow-Ups:
    • Re: Proper use of Header files
      • From: Howard Moon <email@hidden>
    • Re: Proper use of Header files
      • From: Jens Alfke <email@hidden>
References: 
 >Proper use of Header files (From: koko <email@hidden>)

  • Prev by Date: Re: Proper use of Header files
  • Next by Date: Re: Proper use of Header files
  • Previous by thread: Re: Proper use of Header files
  • Next by thread: Re: Proper use of Header files
  • Index(es):
    • Date
    • Thread