Boost logo

Boost Users :

From: Chris Russell (cdr_at_[hidden])
Date: 2003-08-18 22:13:58


In my project, I'm using several different graph objects that are declared
in different namespaces. All of these graphs use default internal color
maps.

Suppose I declare a graph in namespace A. In another namespace, say
namespace B, I attempt to invoke a DFS using the named parameter version of
the call specifying only the visitor and defaulting the rest of the
parameters. Specifically, I do not specify the color map in the named
parameter list. What I expected was that the DFS would find, and use the
default internal color map of the graph declared in namespace A. However, it
appears that it does not and allocates a temporary color map (I assume the
compiler searches namespace B, not A). Subsequently when DFS attempts to
initialize the color map to white, a fault occurs at runtime (I haven't had
time to get into the guts of DFS and figure out exactly why this bombs yet).

I've worked around this by using the standard (sans named parameters)
version of the DFS call (explicitly passing in a reference to the internal
color map).

This seeming interaction between the named parameter mechanism and
namespaces is pretty subtle - if not for the runtime fault, I would likely
have never noticed that the internal property map wasn't being used during
the search. Has anyone else seen this?

- Chris


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net