Boost logo

Boost :

Subject: Re: [boost] A design for geometric objects
From: Bruno Lalande (bruno.lalande_at_[hidden])
Date: 2008-11-14 17:26:46


> I've done something similar, where the default template implementation
> has a member typedef of a particular type `not_specialized`. You can
> see this at:
>
> http://tinyurl.com/5dba48
>
> (look at port_binary_operation_impl and are_port_binary_operable)

Very similar indeed, good idea to use an already needed nested type
instead of my "specialized" one, it prevents the user from having to
know about the trick, which was my main problem about it.

> The method is not perfect as you can fool it into thinking that the
> template has not been specialized for certain arguments by setting the
> typedef used to not_specialized. I don't know whether there is a way
> to prevent that (perhaps make `not_specialized` a private nested
> struct of something?)

Yep, letting "not_specialized" being private will certainly solve this
slight problem.

Bruno


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