Compiler error when using property map get()
Hi,
The get() function for property maps has me puzzled. Calling it in one
context gives a compiler error, while in another context it does not.
A trivial example is below. Note that the code in foo() and main() are
identical. Any guesses as to why the foo() version gives a compiler
error while the main() version does not?
FWIW, the error is:
subgraph.cpp: In member function ‘virtual void MyGraph::foo()’:
subgraph.cpp:15: error: conversion from
‘boost::subgraph_global_property_map
On Fri, 2 Jul 2010, Trevor Harmon wrote:
Hi,
The get() function for property maps has me puzzled. Calling it in one context gives a compiler error, while in another context it does not. A trivial example is below. Note that the code in foo() and main() are identical. Any guesses as to why the foo() version gives a compiler error while the main() version does not?
I think you may not want to inherit from Boost classes; they are not designed for that. You will probably get more predictable behavior if you just have the subgraph as a member rather than as a base class. -- Jeremiah Willcock
On Jul 2, 2010, at 5:13 PM, Jeremiah Willcock wrote:
I think you may not want to inherit from Boost classes; they are not designed for that. You will probably get more predictable behavior if you just have the subgraph as a member rather than as a base class.
I see. I'll do that then. Is there any discussion of this issue ("inheriting from Boost classes considered harmful") somewhere in the Boost docs? (I never noticed one.) Given that Boost is a C++ framework, I'm sure I won't be the last person to try to specialize the classes via inheritance. Just a simple "there be dragons here" admonition would suffice. Trevor
participants (2)
-
Jeremiah Willcock
-
Trevor Harmon