Andre Poenitz <[EMAIL PROTECTED]> writes:

| First of all: I really hate plain pointers so I am probably biased when it
| comes to judge the benefits of implementations using pointers. 
| 
| The problem is, we currently need pointers in order to use virtual
| functions (references are not acceptable, since we can't put them in
| containers for instance...).
| 
| The following proof-of-concept code shows that we can have the pie and eat
| it, i.e. to have value-semantics _and virtual functions:
| 
[...]

| 
| I think using this idiom we could save a lot of pain. Most classes that do
| not have any pointer members do not need copy constructors, assigment
| operators or destructors, so the mistakes are less likely... Not to mention
| memory leaks...
| 
| I'd really like to try this at some time with MathParInset... 
| 
| Comments?

Look at the boost/boost/smart_ptr.hpp
I think that does what you want.

        Lgb

Reply via email to