Boost logo

Boost :

From: Vladimir Prus (ghost_at_[hidden])
Date: 2004-04-12 08:32:56


The default constructor of boost::property is defined as:

    template <class Tag, class T, class Base = no_property>
    struct property : public Base {
         ....
         property() { }

So, for the case where T = builtin type or a pointer, it's simply not
initialized, per rules in 12.6.2/4. Is this desired behaviour? I was bitted
by this twice, because I have:

   typedef boost::property< semantics_tag, Semantic*,
                         boost::property< boost::edge_weight_t, unsigned > >
    EdgeProperties;

and neither of properties is initialized when I do:

    add_edge(v1, v2, g);

Maybe, the ctor should be:

   property() : m_value() {}

?

- Volodya


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