Subject: Re: [boost] [Review] Type Traits Extension by Frederic Bron - Review summary and decision
From: Max Sobolev (macsmr_at_[hidden])
Date: 2011-04-22 08:49:07
On 21.04.2011 23:13, Stewart, Robert wrote:
> Remember that "has_" implies ownership or inherent characteristic which doesn't apply to a namespace scope operator.
Class must have only intrinsic member functions, without which it
doesn't working. Extended part of interface defines out of class body
(perhaps in a separate module) in the same namespace, in terms of
intrinsic member functions. This decrease coupling of code.
(This C++ Software Construction approach was clearly described and
proposed in Czarnecki/Eisenecker "Generative Programming". - S.Meyers
agree; H.Sutter agree; D.Abrahams :) agree.)
Consider Barton/Nackman trick as it presents in Boost.Operators library:
boost::equality_comparable<T> require from T operator < is being defined
(as member or free operator function, doesn't matter). Operators >, <=,
>= are generated automatically as free operator functions due to
But there is no difference between 4 operators <, >, <= and >= from
point of view its meaning and "status": they all makes interface of
class T. Operators >, <=, >= aren't second class citizens, even if
operator < is define as member operator function.
-- - Do you speak English? ÐÑÐ¶Ð¸Ðº Ñ Ð³Ð»ÑÐ±Ð¾ÐºÐ¸Ð¼ Ð²Ð·Ð´Ð¾Ñ Ð¾Ð¼: - Yes I do. Ð Ñ ÑÐ»Ð¸ ÑÐ¾Ð»ÐºÑ?
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk