
Hello, I have encountered some problems with bundled properties in BGL. The following syntax works: property_map<CFD2CSM_graph_t, bool CFD2CSM_vertex_t::*>::type is_CSM_map = get(&CFD2CSM_vertex_t::is_CSM_node, CFD2CSM_graph); However, if I make two statements out of it I get some type-mismatch error property_map<CFD2CSM_graph_t, bool CFD2CSM_vertex_t::*>::type is_CSM_map; is_CSM_map = get(&CFD2CSM_vertex_t::is_CSM_node, CFD2CSM_graph); What is the reason for this behavior? Why is the second statement not ok? Cheers, Marc -- DSL Komplett von GMX +++ Superg�nstig und stressfrei einsteigen! AKTION "Kein Einrichtungspreis" nutzen: http://www.gmx.net/de/go/dsl

Hello, it looks like there is missing the default constructor in the class template<typename Graph, typename Descriptor, typename Bundle, typename T> struct bundle_property_map : put_get_helper<T&, bundle_property_map<Graph, Descriptor, Bundle, T> > I have just added bundle_property_map(){} into the class and it seems to work alright. However I don't know if this is a correct solution and the default constructor was just forgotten, or if this may lead to some unwanted behavior with bundled properties. It would be nice to get some feedback on this. Cheers, Marc --- Weitergeleitete Nachricht / Forwarded Message --- Date: Thu, 17 Mar 2005 01:42:40 +0100 (MET) From: manitou@gmx.ch To: boost-users@lists.boost.org Subject: BGL - bundled properties Hello, I have encountered some problems with bundled properties in BGL. The following syntax works: property_map<CFD2CSM_graph_t, bool CFD2CSM_vertex_t::*>::type is_CSM_map = get(&CFD2CSM_vertex_t::is_CSM_node, CFD2CSM_graph); However, if I make two statements out of it I get some type-mismatch error property_map<CFD2CSM_graph_t, bool CFD2CSM_vertex_t::*>::type is_CSM_map; is_CSM_map = get(&CFD2CSM_vertex_t::is_CSM_node, CFD2CSM_graph); What is the reason for this behavior? Why is the second statement not ok? Cheers, Marc -- DSL Komplett von GMX +++ Supergünstig und stressfrei einsteigen! AKTION "Kein Einrichtungspreis" nutzen: http://www.gmx.net/de/go/dsl -- SMS bei wichtigen e-mails und Ihre Gedanken sind frei ... Alle Infos zur SMS-Benachrichtigung: http://www.gmx.net/de/go/sms

On Mar 17, 2005, at 5:07 AM, manitou@gmx.ch wrote:
it looks like there is missing the default constructor in the class
template<typename Graph, typename Descriptor, typename Bundle, typename T> struct bundle_property_map : put_get_helper<T&, bundle_property_map<Graph, Descriptor, Bundle, T> >
I have just added
bundle_property_map(){}
into the class and it seems to work alright. However I don't know if this is a correct solution and the default constructor was just forgotten, or if this may lead to some unwanted behavior with bundled properties. It would be nice to get some feedback on this.
The default constructor was omitted intentionally, because a default-constructed bundle_property_map doesn't have any sane semantics. If you try to use it, you'll essentially be dereferencing a NULL member pointer. I'm not opposed to adding a default constructor for bundle_property_map, if you need it. But I'm curious why you're using it? Doug
participants (2)
-
Douglas Gregor
-
manitou@gmx.ch