Re: Feedback needed, especially non-Linux

al davis <[email protected]>
Newsgroups gmane.comp.gnu.gnucap.devel
Message-ID <[email protected]>
On Thursday 22 February 2007 20:12, David Fang wrote:
> In my copy of TC++PL, 2nd Ed., Sec. 21.5.2: Closing of
> Streams (pp. 639-40) discusses the matter.  (Don't you love
> this book? :^D )

Ah...  I didn't see it because I looked in the wrong places.

>
> In the Standard, it's in sections [iostream.objects: 27.3?,
> ios.Init: 27.4.2.1.6?].  (I don't actually have a copy handy,
> just found mention of in in Google, hope chapter numbers are
> right.)  Anyhow, it's not a hack, it is "good design", I'm
> sure Bjarne himself would attest!

I am not so sure about this.  We all hack.  One hack vs. 
another.  I doubt if there are any nontrivial programs without 
at least a few ugly hacks.

It gives me an idea ...  Where it now prints "improper link 
order", construct it.  Instead of a map, have a pointer to map, 
use new and delete.  It is the map that needs initializing.


> I've witnessed at least one system where the order of
> translation unit global destruction is *not* the reverse of
> the ordering chosen in initialization.  :( 

I am aware of one, from long ago.  The destruction order was 
exactly the construction order.  Perfectly wrong.

> Nevertheless, 
> using the ios_base::Init technique should be robust to even
> the most nonsensical TU-orderings!

I am not sure, but I see a way to test it.

Thanks.  I will try it.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.