220 15318 <70cb668c-232f-44a6-835f-e78fb7ae0056@isocpp.org> article
Path: news.gmane.org!not-for-mail
From: Andy Prowl <andy.prowl@gmail.com>
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Re: Re: Isn't it time we had the bool
 std::[container]::contains() family of methods?
Date: Fri, 26 Dec 2014 07:13:24 -0800 (PST)
Lines: 90
Approved: news@gmane.org
Message-ID: <70cb668c-232f-44a6-835f-e78fb7ae0056@isocpp.org>
References: <0959f2f8-acdd-4786-b6f3-0f05c62dcee6@isocpp.org>
 <2df86492-548f-42c8-86d6-fe1c8ba3a5a9@isocpp.org>
 <2f390ec3-b259-4150-9771-cd0d02860348@isocpp.org>
 <3743ebda-3367-4fc3-922a-f38d98e57889@isocpp.org>
 <1bccb2dd-4aa4-4f07-8958-b1d6bf092630@isocpp.org>
 <CAFdMc-1aLe089fve2GvPGx9c-5tkbft4t3NdGugx4_QZSfv7-w@mail.gmail.com>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: plane.gmane.org
Mime-Version: 1.0
Content-Type: multipart/mixed; 
	boundary="----=_Part_684_947562529.1419606804786"
X-Trace: ger.gmane.org 1419606813 25113 80.91.229.3 (26 Dec 2014 15:13:33 GMT)
X-Complaints-To: usenet@ger.gmane.org
NNTP-Posting-Date: Fri, 26 Dec 2014 15:13:33 +0000 (UTC)
To: std-proposals@isocpp.org
Original-X-From: std-proposals+bncBCG63E4DYQKRBFPW6WSAKGQE3PLK6QA@isocpp.org Fri Dec 26 16:13:28 2014
Return-path: <std-proposals+bncBCG63E4DYQKRBFPW6WSAKGQE3PLK6QA@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-pd0-f200.google.com ([209.85.192.200])
	by plane.gmane.org with esmtp (Exim 4.69)
	(envelope-from <std-proposals+bncBCG63E4DYQKRBFPW6WSAKGQE3PLK6QA@isocpp.org>)
	id 1Y4WZz-0005y6-Aq
	for gclcip-std-proposals@m.gmane.org; Fri, 26 Dec 2014 16:13:27 +0100
Original-Received: by mail-pd0-f200.google.com with SMTP id r10sf75797855pdi.7
        for <gclcip-std-proposals@m.gmane.org>; Fri, 26 Dec 2014 07:13:26 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20120113;
        h=date:from:to:message-id:in-reply-to:references:subject:mime-version
         :content-type:x-original-sender:reply-to:precedence:mailing-list
         :list-id:list-post:list-help:list-archive:list-subscribe
         :list-unsubscribe;
        bh=CM17GdpVrRSdy3StpsDKhYdlvdKDcolrLwXhdXyK1rk=;
        b=O0Tnvs8DxyZZCTfKXI4+4a2yTdJ5A4DTOEC1hHAIhGt39JaKMg06CXI+obbl21YCtS
         fSCajE9ZMeE7Pi2zBAi2UbZ9g14kelxFmXXtRt28DmSQvW5iJwf1hVAxFjMMVis78FfF
         H0Es0J0wloBEjCleCCqXlK7NYhhfoezJ54+cb2ebQEFKIjMEMk4Vjjs2buQ3Y1aC8y7I
         0zxlZp06TOTkOshyc+KDg7d6Nc2hBFyvIOvw55VLZS43D3N/WSWXVaLN5YyMd9GDXFg7
         jbIsL4C4EIcXZSQGIcArvRichbRUtwGcdcdy7W6Zm+SuopTC4Laesw2uXZr4gbbS9fB2
         0Y8A==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20130820;
        h=x-gm-message-state:date:from:to:message-id:in-reply-to:references
         :subject:mime-version:content-type:x-original-sender:reply-to
         :precedence:mailing-list:list-id:list-post:list-help:list-archive
         :list-subscribe:list-unsubscribe;
        bh=CM17GdpVrRSdy3StpsDKhYdlvdKDcolrLwXhdXyK1rk=;
        b=YoaTCI6rgvX5oY3yirklhQB7ok1/itAXhjTWEJsHp18Y0AB/hF3GDA5hcDxPEkzesZ
         08IRPxn8rLiLwvQ8NFx2TsLGKbQlKP2IdG6LHjQGxBgaFS+G89UaGaKcrL1+PIJC0l+Z
         mLjom+ufB1IcZP2BoJ5dQ+dAQ0s9pZHJbgShyAbUbfGuTbWkanpyQerbx0w7asAg4EdE
         JWZmCZqMLLOilK8dLOPDoDGFChuC0zesgMYJpRF604thBoRN7ASisugeHZ9bgHlmm4QE
         ZKzFo3nnTCIW3BUAFuO2C0KMmXfdBrkyVhlekMzbolYSP1ZBO54Kph0iyRlL9T02dIDy
         ggFQ==
X-Gm-Message-State: ALoCoQk8qfORUPGGt2aLsRl8hNyN5SPI/MIW+hZGVjv8kkDYq/wvwM5TWC0tRVISA49FEXpDXITZ
X-Received: by 10.66.65.109 with SMTP id w13mr10767198pas.28.1419606806051;
        Fri, 26 Dec 2014 07:13:26 -0800 (PST)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.140.85.69 with SMTP id m63ls3279845qgd.93.gmail; Fri, 26 Dec
 2014 07:13:25 -0800 (PST)
X-Received: by 10.140.42.229 with SMTP id c92mr6731qga.29.1419606805156;
        Fri, 26 Dec 2014 07:13:25 -0800 (PST)
In-Reply-To: <CAFdMc-1aLe089fve2GvPGx9c-5tkbft4t3NdGugx4_QZSfv7-w@mail.gmail.com>
X-Original-Sender: andy.prowl@gmail.com
Precedence: list
Mailing-list: list std-proposals@isocpp.org; contact std-proposals+owners@isocpp.org
List-ID: <std-proposals.isocpp.org>
X-Google-Group-Id: 399137483710
List-Post: <http://groups.google.com/a/isocpp.org/group/std-proposals/post>, <mailto:std-proposals@isocpp.org>
List-Help: <http://support.google.com/a/isocpp.org/bin/topic.py?topic=25838>, <mailto:std-proposals+help@isocpp.org>
List-Archive: <http://groups.google.com/a/isocpp.org/group/std-proposals/>
List-Subscribe: <http://groups.google.com/a/isocpp.org/group/std-proposals/subscribe>,
 <mailto:std-proposals+subscribe@isocpp.org>
List-Unsubscribe: <mailto:googlegroups-manage+399137483710+unsubscribe@googlegroups.com>,
 <http://groups.google.com/a/isocpp.org/group/std-proposals/subscribe>
Xref: news.gmane.org gmane.comp.lang.c++.isocpp.proposals:15318
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/15318>

------=_Part_684_947562529.1419606804786
Content-Type: multipart/alternative; 
	boundary="----=_Part_685_2092182398.1419606804787"

------=_Part_685_2092182398.1419606804787
Content-Type: text/plain; charset=UTF-8

On Friday, December 26, 2014 12:05:46 PM UTC+1, dgutson wrote:
 

> One of the nice things of interfaces is that you only need to look in a 
> single place: if you want to know what a class can do, just look to a 
> bounded (close) set of methods delimited by the interface, rather than 
> having to look to a bunch of functions spread along random header files, 
> which reminds me C.
> So, if we will enjoy uniform call syntax, I would vote for the member 
> version so the nonmember will come for free
>
Well, you can put the declaration of the non-fundamental functions which 
are part of a class's logical interface in the header that comes with that 
class, and in the same namespace as the class. This is the gist of the Interface 
Principle <http://www.gotw.ca/publications/mill08.htm> (the article is old, 
but still valid). This way, you'd still have one single place to look at 
when you want to know what a class can do, but you won't make the class's 
interface larger than necessary.

Notice, that it is generally not possible to declare all functions that 
work with a class as member functions of that class, so having free 
functions (or member functions of *other* classes, but that does not 
eliminate the problem of functionality being "spread along random header 
files") is unavoidable.

Kind regards,

Andy

-- 

--- 
You received this message because you are subscribed to the Google Groups "ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an email to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposals/.

------=_Part_685_2092182398.1419606804787
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">On Friday, December 26, 2014 12:05:46 PM UTC+1, dgutson wr=
ote:<div>&nbsp;</div><blockquote class=3D"gmail_quote" style=3D"margin: 0;m=
argin-left: 0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;"><p>One of=
 the nice things of interfaces is that you only need to look in a single pl=
ace: if you want to know what a class can do, just look to a bounded (close=
) set of methods delimited by the interface, rather than having to look to =
a bunch of functions spread along random header files, which reminds me C.<=
br>
So, if we will enjoy uniform call syntax, I would vote for the member versi=
on so the nonmember will come for free</p></blockquote><div>Well, you can p=
ut the declaration of the non-fundamental functions which are part of a cla=
ss's logical interface in the header that comes with that class, and in the=
 same namespace as the class. This is the gist of the <a href=3D"http://www=
..gotw.ca/publications/mill08.htm">Interface Principle</a>&nbsp;(the article=
 is old, but still valid). This way, you'd still have one single place to l=
ook at when you want to know what a class can do, but you won't make the cl=
ass's interface larger than necessary.<br><br>Notice, that it is generally =
not possible to declare all functions that work with a class as member func=
tions of that class, so having free functions (or member functions of <i>ot=
her</i> classes, but that does not eliminate the problem of functionality b=
eing "spread along random header files") is unavoidable.<br><br>Kind regard=
s,<br><br>Andy</div></div>

<p></p>

-- <br />
<br />
--- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals&quot; group.<br />
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <a href=3D"mailto:std-proposals+unsubscribe@isocpp.org">std-proposa=
ls+unsubscribe@isocpp.org</a>.<br />
To post to this group, send email to <a href=3D"mailto:std-proposals@isocpp=
..org">std-proposals@isocpp.org</a>.<br />
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/">http://groups.google.com/a/isocpp.org/group/std-proposals/<=
/a>.<br />

------=_Part_685_2092182398.1419606804787--
------=_Part_684_947562529.1419606804786--

.
