Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > C++ Moderated > Re: Compilation...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 15 of 16 Topic 9546 of 9828
Post > Topic >>

Re: Compilation speedup trick: any side-effects?

by Francis Glassborow <francis.glassborow@[EMAIL PROTECTED] > Apr 28, 2008 at 04:03 PM

Andre Poenitz wrote:

> 
>> In addition the introduction of modules (delayed till a TR after the
>> release of C++0x) will make miuch of what you are currently doing
>> counter productive.
> 
> My second guess in this mail is that we also can safely assume that
> the OP has an actual problem, and he has it _now_. I fail to see how
> pointing to some "TR after the release of C++0x" helps in this scenario.
> 
> Andre'
> 
With respect, that is not something I would ever choose to 'safely
assume'. Many programmers spend time wanting to save time :) Complete
rebuilds for large projects are things to leave for natural breaks (over
lunch, over-night and, I suppose in extreme cases, over a weekend though
I have never come across a project where that was necessary)

Note that IBM had a C++ compiler that effectively did something like the
OP's proposal but that was a decade ago. The problem with it was that it
was inherently non-standard and no way to fix it to make it standard
conforming.

Now to the problem of unexpected overloads. Consider:

in file1.cpp

namespace {
      void foo(int){
         // some defintion
}

void bar(){
     long val(23);
     foo(val);
// other code
}


in file2.h
     void foo(long){
        // some definition
}


Now the later visible to the former results in silent change. Yes I know
this is absurd code but it is just to illustrate that we cannot just
concatenate files and expect everything to be fine. Compile time errors
are 'OK' because we can fix them but silent change is a disaster waiting
to happen. When I write code in a .cpp file using an unnamed namespace I
am assuming that the names I use there are not going to leak out (though
I think there are now some implications if I have a compiler that uses
ex****t). The unnamed namespace of a .cpp file being written by me is
mine and I should not have to spend time worrying about possible naem
conflicts with code in other files (other than those I explicitly include)


-- 
      [ See http://www.gotw.ca/resources/clcm.htm
for info about ]
      [ comp.lang.c++.moderated.    First time posters: Do this! ]
 




 16 Posts in Topic:
Compilation speedup trick: any side-effects?
borphi@[EMAIL PROTECTED]   2008-04-25 11:13:19 
Re: Compilation speedup trick: any side-effects?
rado <rgetov@[EMAIL PR  2008-04-25 15:49:57 
Re: Compilation speedup trick: any side-effects?
Francis Glassborow <fr  2008-04-25 16:13:19 
Re: Compilation speedup trick: any side-effects?
Davis King <davis685@[  2008-04-25 16:17:05 
Re: Compilation speedup trick: any side-effects?
Brendan <catphive@[EMA  2008-04-25 16:13:20 
Re: Compilation speedup trick: any side-effects?
Maciej Sobczak <see.my  2008-04-25 17:13:19 
Re: Compilation speedup trick: any side-effects?
Mathias Gaunard <loufo  2008-04-26 03:33:38 
Re: Compilation speedup trick: any side-effects?
Carl Barron <cbarron41  2008-04-26 03:34:04 
Re: Compilation speedup trick: any side-effects?
"borphi@[EMAIL PROTE  2008-04-26 09:43:22 
Re: Compilation speedup trick: any side-effects?
Francis Glassborow <fr  2008-04-26 16:28:03 
Re: Compilation speedup trick: any side-effects?
Francis Glassborow <fr  2008-04-26 16:27:40 
Re: Compilation speedup trick: any side-effects?
mlag.ng@[EMAIL PROTECTED]  2008-04-27 07:12:05 
Re: Compilation speedup trick: any side-effects?
Mathias Gaunard <loufo  2008-04-27 07:29:16 
Re: Compilation speedup trick: any side-effects?
Andre Poenitz <poenitz  2008-04-27 15:45:41 
Re: Compilation speedup trick: any side-effects?
Francis Glassborow <fr  2008-04-28 16:03:16 
Re: Compilation speedup trick: any side-effects?
Peter Holtwick <borphi  2008-04-29 10:43:23 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Thu Jul 24 15:56:20 CDT 2008.