Boost logo

Boost :

Subject: Re: [boost] [RFC] Protocol for operator. (dot) overloading
From: Corrado Zoccolo (czoccolo_at_[hidden])
Date: 2008-10-06 11:23:53


Hi Matias, <http://www.research.att.com/%7Ebs/bs_faq2.html#overload-dot>

On Mon, Oct 6, 2008 at 2:02 AM, Mathias Gaunard <
mathias.gaunard_at_[hidden]> wrote:

> Such a complicated and specific mechanism.
>
> I think a lot of people come up with lots of approaches at overloading the
> dot operator which really do not truly overload its meaning.
>

actually, my proposal approximates in current C++ Gary Powell's, Doug
Gregor's and Jaakko Jaarvi's proposal (see WG21/N1671), and is inline with
Stroustrup's initial idea of what overloading operator. would be in C++, if
it was allowed (see:
http://www.research.att.com/~bs/bs_faq2.html#overload-dot>,
or D&E).

>
> What that operator takes is an an object, a name, and arguments. Therefore,
> in my opinion, overloading the dot operator should mean calling a function
> with a compile-time string and those arguments. Then, with proper
> compile-time introspection support (an mpl map of compile-time strings to
> functor types), one can for example choose to call a member function with
> that name on some type, or do something else.
>

This idea is nice, but it introduces an asymmetry with how operator -> is
handled. Moreover, the same counter arguments as those for not overloading
operator :: (scope resolution) hold (see:
http://www.research.att.com/~bs/bs_faq2.html#overload-dot>).

Corrado

> _______________________________________________
> Unsubscribe & other changes:
>
http://lists.boost.org/mailman/listinfo.cgi/boost
>

-- 
__________________________________________________________________________
dott. Corrado Zoccolo                          mailto:czoccolo_at_[hidden]
PhD - Department of Computer Science - University of Pisa, Italy
--------------------------------------------------------------------------

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