|
Boost : |
From: Jeremy Siek (jsiek_at_[hidden])
Date: 2001-04-04 22:32:36
Hi Hrant,
So there's two issues here:
1) the requirement for Default Constructible
I'm afraid this requirement is intentional and will not
be removed. The reason for this is that the filter iterator
adaptor has to be Default Constructible to be a C++ Standard
conformant iterator, and the predicate
needs to be contained in the iterator by-value (for
performance reasons).
2) The crash on MSVC++
I believe this is due to a bug in the MSVC++ compiler
with regards to generating the copy constructor
for your ColorTolerance class. I suggest adding
an explicit copy constructor to this class to
avoid the MSVC++ bug. Also, it would be great
if you could report this bug to Microsoft.
Cheers,
Jeremy
On Wed, 4 Apr 2001, Yardumian, Hrant (HEYA) wrote:
HEYA> Jeremy:
HEYA>
HEYA> Thanks for your response. I have included all the files below. The most
HEYA> relevant
HEYA> ones are main.cpp, ColorTolerance.h and WeightTolerance.h. Boost typedefs
HEYA> are
HEYA> in GraphTypes.h. If you can't open these files please let me know and I
HEYA> will send
HEYA> them in a different form
HEYA>
HEYA> The attached code will crash on MSVC++.
HEYA>
HEYA> I should mention that related to filtered_graph, a colleague of mine made a
HEYA> bugfix
HEYA> in boost/iterator_adaptors.hpp. In class filter_iterator_generator, he
HEYA> added public
HEYA> before the BOOST_STATIC_CONSTANT line. The code was not even compiling
HEYA> until that was done.
HEYA>
HEYA> Please note that:
HEYA> 1) in main.cpp, in the bottom of the listing where the filtered graph is
HEYA> created,
HEYA> if the commented out line is used instead, (with only an edge
HEYA> predicate)
HEYA> then this code will work fine.
HEYA> 2) in ColorTolerance.h, if the commented out default constructor is used,
HEYA> and
HEYA> the commented out code for operator() is used, the run will not crash,
HEYA> but it will
HEYA> still not filter the graph appropriately.
HEYA>
HEYA>
HEYA> <<GraphTypes.h>> <<Output.h>> <<ColorTolerance.h>> <<printGraph.h>>
HEYA> <<WeightTolerance.h>> <<main.cpp>> <<Output.cpp>> <<FilteredGraph.dsp>>
HEYA> <<FilteredGraph.dsw>>
HEYA>
HEYA>
HEYA> Hrant E. Yardumian
HEYA> Chevron Petroleum Technology Co.
HEYA> 6001 Bollinger Canyon Rd. E-1192
HEYA> San Ramon, CA 94583
HEYA>
HEYA> Phone:(925) 842-6265
HEYA> Fax :(925) 842-6283
HEYA>
HEYA> To unsubscribe, send email to: <mailto:boost-unsubscribe_at_[hidden]>
HEYA>
HEYA>
HEYA> Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
HEYA>
HEYA>
----------------------------------------------------------------------
Jeremy Siek www: http://www.lsc.nd.edu/~jsiek/
Ph.D. Candidate email: jsiek_at_[hidden]
Univ. of Notre Dame work phone: (219) 631-3906
----------------------------------------------------------------------
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk