Boost logo

Boost :

From: Lorenzo Bettini (bettini_at_[hidden])
Date: 2005-06-07 01:50:28

Eric Niebler wrote:
> 2) Grab tracking_ptr.hpp from
> boost-sandbox/boost/xpressive/detail/utility (can also be found in
> from the Boost Sandbox File Vault).
> I had to solve the same problem for xpressive, where regex objects can
> embed other regex objects, either "by value" or "by reference". This
> leads to all sorts of interesting cyclic ref-count scenarios. I use
> tracking_ptr to handle this.

indeed also my context has to do with regular expressions and mutual
cyclic ref-count scenarios (in source-highlight As I said in a response to a
previous post, I solved the problem by storing weak pointers in the
cyclic structures and store a shared pointer into a list that is kept
alive for all the life of the cyclic structures.

> Unfortunately, tracking_ptr is not documented. I forces you to separate
> your object into a handle-body, where the body inherits from
> enable_reference_tracking<Body>, and the handle holds a
> tracking_ptr<Body>. There's more, but maybe you can figure out the rest
> by seeing how xpressive uses tracking_ptr.

OK, thanks!

|  Lorenzo Bettini          ICQ# lbetto, 16080134     |
|  PhD in Computer Science                            |
|  Dip. Sistemi e Informatica, Univ. di Firenze       |
|  Florence - Italy        (GNU/Linux User # 158233)  |
|  Home Page        :    |
|         XKlaim language  |
|    Cover Band  |
|           |
|              |
|       |
|    |

Boost list run by bdawes at, gregod at, cpdaniel at, john at