Boost logo

Boost :

From: Joel de Guzman (joel_at_[hidden])
Date: 2007-10-09 19:00:33

Joel de Guzman wrote:
> Steven Watanabe wrote:
>> Simonson, Lucanus J <lucanus.j.simonson <at>> writes:
>>> I
>>> tried to explain that non-member, non-friend functions were supposed to
>>> be the way to go with the first revision of the library, and they
>>> overruled me. In the end I agreed with them that having objects that
>>> fully encapsulate the behavior of geometry types is nicer and worth some
>>> effort, maybe even make a tradeoff or two to get it.
>> Using free functions and ADL can be dangerous since
>> there is always the chance of accidentally picking
>> up a function that means something totally different.
> Yeah ADL is bad.
>> Traits don't have this limitation. In some ways this
>> is like creating an adapter as you are doing. The difference
>> is that the adaptation layer operates on any instance
>> of the adapted type rather than on one stored inside it.
> Traits, however, have the tendency to become "metafunction blobs"
> that are cumbersome to use in TMP if you don't do it right.
> There are a couple of ways to get around these problems
> (both ADL and metafunction blobs).


"How Non-Member Functions Improve Encapsulation"
-Scott Meyers


Joel de Guzman

Boost list run by bdawes at, gregod at, cpdaniel at, john at