On Tue, 2008-11-18 at 16:45 -0800, Cliff Jansen (Interop Systems Inc) wrote: > Greetings qpid-dev, > ... > I have attached a patch that avoids the use of std::lower_bound() and > uses a simpler but slower linear search when compiling on Windows in > debug mode. That seems to be the easiest way to solve the problem > without intrusive code changes after the M4 code freeze. > > The patch is attached. Let me know if it requires reworking in any > way.
There are 2 problems with this patch (as far as our general c++ programming conventions): 1. We don't have code which is platform dependent outside the platform area .. <qpid>/cpp/src/qpid/sys/ [Any exception you may have found need to be hunted down and shot!]. 2. We try very hard to avoid conditionally compiled code at all and we've largely succeeded [There are very few outside of header guards]. As they are a slippery slope to unmaintainable code. --- In any case although you've phrased the test as a platform test (#ifdef _WIN32) it's actually supposed to be a test for a specific compiler [gcc runs quite happily in a at least 3 incarnations on WIN32]. I'd really much prefer a real fix for the underlying code problem rather than a hack which just makes the code compile for a specific compiler. As far as I can tell the Microsoft compiler has picked up a valid problem with the code that gcc did not - the problem needs to be fixed. Andrew
