Boost logo

Boost :

From: Steve M. Robbins (steven.robbins_at_[hidden])
Date: 2002-05-15 20:53:01


Hi,

I'm using the graph library with my own visitor class.
The docs for breadth-first search visitors

  http://www.boost.org/libs/graph/doc/BFSVisitor.html

say that the visitor must be copy constructible.
My visitor is, and the code compiled fine with GCC.

However, SGI's MIPSpro 7.30 compiler complained about line 123
of boost/graph/breadth_first_search.hpp:

    bfs_visitor(Visitors vis = Visitors()) : m_vis(vis) { }

Ultimately, I'm calling this constructor with a "Visitors"
class (it's a template parameter) that does NOT have a
default constructor. But I'm always calling it as

    bfs_visitor( my_visitor() )

and not

    bfs_visitor()

So the default value "vis = Visitors()" shouldn't be needed,
should it? Is one of my compilers right and the other wrong,
or is this an unspecified area of the C++ standard?

If MIPSpro is right, then the BGL docs need to be amended
so that visitors are default constructible? Or is there a
better way to fix it?

If GCC is right, then is there a reasonable workaround for
MIPSpro that can be added to boost? [For the moment, I'm just
adding the default constructor.]

Thanks,
-Steve


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