Boost logo

Boost :

From: Pavol Droba (droba_at_[hidden])
Date: 2005-03-24 15:42:19


On Thu, Mar 24, 2005 at 07:30:42PM +0100, Thorsten Ottosen wrote:
 
> I think so. Let's assume we want the functions to be named
>
> namespace boost
> {
> range_begin();
> range_end();
> range_size();
> }
>
> then we can put the metafunctions into
> a namespace like
>
> namespace boost
> {
> namespace range
> {
> struct iterator;
> struct const_iterator;
> struct value;
> struct size;
> struct difference;
> }
> }
>
> The implementation then does
>
> namespace boost
> {
> template< class T >
> typename range::iterator<T>::type begin( T& r )
> { return range_begin(r); }
> }
>
> To summarize this extension protocol
>
> - put range_begin() etc in your types namespace
> - (partial) specialize range::X for all X
>
> The library protocol would be
>
> - put library name as prefix on ADL hooks
> - put metafunctions in a namespace with the name of the library
>

I have nothing much to add then simple "I like it".

Just a small clarification, I would rewrite paragraph:

"
 The library protocol would be
 
 - put concept name as prefix on ADL hooks
 - put metafunctions in a namespace with the name of the concept
"

Regards,

Pavol.


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