
27 May
2004
27 May
'04
7:09 a.m.
Joel de Guzman wrote:
Consider:
rule<> a = x;
or:
rule<> a; a = x;
How should this behave if x is an int_p?
The int_p gets stored in an object on the heap, and the rule<> stores a shared_ptr to a polymorphic base.
Now how should it behave if x is another rule? Consider a concrete example (snipped from the pascal parser):
rule<> identifier; rule<> fileIdentifier;
identifier = ....
fileIdentifier = identifier; // an alias
The shared_ptr's reference count goes up. What's the problem? -- Eric Niebler Boost Consulting www.boost-consulting.com