Boost logo

Boost :

From: rogeeff (rogeeff_at_[hidden])
Date: 2002-02-24 20:29:24


--- In boost_at_y..., "deane_yang" <Deane_Yang_at_y...> wrote:
> Good grief. Who is NOT interested? Please post the details!

Author Paul Hollingsworth.

disable4786.h:

#pragma warning(disable:4786)
// http://support.microsoft.com/support/kb/articles/Q167/3/55.ASP
// states that yes, it's a compiler bug that
// #pragma warning(disable: 4786) doesn't always work.

// They don't, however, list a workaround.

// I found that, very strangely, #including <iostream> made the
// remaining 4786 warnings go away!

// Of course, #including <iostream> is inefficient and
// slows compilation - so I whittled away most of what's in
// <iostream> and discovered that the "active ingredient" in
// <iostream> appears to be a declaration of a static class,
// complete with default constructor.

// For some reason, this works around the bug!
// Why does this work? Beats me, ask those smart guys at MS who
// wrote the compiler.

class msVC6_4786WorkAround {
public:
     msVC6_4786WorkAround() {}
};

static msVC6_4786WorkAround
WowIWonderWhatCrapCodeMustBeInTheCompilerToMakeThisWorkaroundWork;

// End of File

////////////////////////////////////////////////////////////////

Gennadiy.


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk