Thanks in advance for answering this question.
whynot write code in stdafx.cpp?
Collapse
This topic is closed.
X
X
-
Egbert Nierop \(MVP for IIS\)Tags: None -
Nishant Sivakumar
Re: whynot write code in stdafx.cpp?
With what purpose?
--
Regards,
Nish [VC++ MVP]
"Egbert Nierop (MVP for IIS)" <egbert_nierop@ nospam.invalid> wrote in
message news:%23ACXjZCl FHA.3828@TK2MSF TNGP12.phx.gbl. ..[color=blue]
> Thanks in advance for answering this question.[/color]
-
Carl Daniel [VC++ MVP]
Re: whynot write code in stdafx.cpp?
Egbert Nierop (MVP for IIS) wrote:[color=blue]
> Thanks in advance for answering this question.[/color]
Convention, pure and simple. There's really no reason to have a
stdafx.cpp - if there's a central source file that contains code that will
rarely change, there's nothing wrong with using that as the PCH builder.
The reason for the convention is just that - PCH building is expensive, and
typically you should only put things in your "stdafx.h" that rarely or never
change. Using a non-empty source file as the PCH builder means that you'll
rebuild the PCH file unnecessarily every time the code in that file changes
even if none of your #includes changed.
-cd
Comment
-
HOTDOG
Re: whynot write code in stdafx.cpp?
"Carl Daniel [VC++ MVP]" wrote:
[color=blue]
> Egbert Nierop (MVP for IIS) wrote:[color=green]
> > Thanks in advance for answering this question.[/color]
>
> Convention, pure and simple. There's really no reason to have a
> stdafx.cpp - if there's a central source file that contains code that will
> rarely change, there's nothing wrong with using that as the PCH builder.
>
> The reason for the convention is just that - PCH building is expensive, and
> typically you should only put things in your "stdafx.h" that rarely or never
> change. Using a non-empty source file as the PCH builder means that you'll
> rebuild the PCH file unnecessarily every time the code in that file changes
> even if none of your #includes changed.
>
> -cd
>
>
>[/color]
Comment
Comment