Boost logo

Boost :

From: David Abrahams (dave_at_[hidden])
Date: 2003-11-15 18:23:18


Brian McNamara <lorgon_at_[hidden]> writes:

> I feel like most C++ programmers have become so accustomed to the
> "happy accident of structural conformance" that they think it is the
> common case. It's not. Aside from functionality named by (1)
> operators or (2) a handful of common names that have fallen into
> common usage (like "swap" and "clone"), the chances that
> some-random-library-
> is-going-to-just-happen-to-present-an-interface-which-exactly-
> structurally-conforms-to-the-concepts-you-developed-independently
> are nearly zero.

Most C++ programmers do seem to miss this. Furthermore, if you were
"lucky" enough to have the happy accident, you'd almost surely have
the wrong semantics. For that reason, I am extremely suspicious of
structural conformance for most purposes. I'm still on the fence
about copy constructors and assignment operators, in part because they
have special status in the language, but that's about it.

-- 
Dave Abrahams
Boost Consulting
www.boost-consulting.com

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