[Dune] Transition from SmartPointer to shared_ptr

Markus Blatt Markus.Blatt at iwr.uni-heidelberg.de
Thu Oct 15 15:30:38 CEST 2009


On Thu, Oct 15, 2009 at 02:43:29PM +0200, Oliver Sander wrote:
> I do not blame you for not sticking to the standard 100%.
> Yet I am convinced that using standard implementations
> whenever possible is a good thing.  I am happy to discuss
> this issue in private or plenary if you think it necessary.
> 

I agree that using the standard implementations whenever possible is a
good thing. (Still we claim to support some compilers that do not
incorporate TR1.)

But I do not think that reimplementing the (full) standard is the
right way. 

The approach we used for tuples and no the shared_ptr is to implement
just a restricted functionality and provide it under the same
name. Sometimes even with different semantics. In the case
of a compiler supporting TR1 the user has the full standard support if
not it is limited and might have different behaviour.

This is DANGEROUS and not clean!

If a user needs the standard implementations he should use a compiler
which supports it and use the stuff from namespace std. If he chooses
the wrong compiler his code will simply not compile. (Currently he can
pretend that he uses the std stuff but once he or someone using his
code with an unsuitable compiler might get strange bugs.)

If we want to provide just a part of the standard implementation we can do
that, but should make that clear by using a different name. (Or start
the unfeasable task of implementing it correctly and fully).

If we think that some tr1 stuff is absolutely necessary, we might
think of dropping support for some older compilers instead.

Markus




More information about the Dune mailing list