Topic: Concepts and ADL


Author: "Vicente J. Botet Escriba" <vicente.botet@wanadoo.fr>
Date: Fri, 27 Nov 2015 20:12:04 +0100
Raw View
Hi,

I was looking on the Concept proposal for the impact of concepts and
ADL. I have not reached to identify it.

I was wondering if the namespace on which a concept is defined is
included in the associated set of namespaces  that it will added to the
lookup.

E.g.

namespace CNS {

     concept bool C ....;

     void f(C& c);
};

If type T is a model of concept C, would the following be well formed?

T a;
f(a);


Any pointer is welcome.

Vicente

--

---
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/.

.


Author: Nicol Bolas <jmckesson@gmail.com>
Date: Fri, 27 Nov 2015 16:41:07 -0800 (PST)
Raw View
------=_Part_11313_211198393.1448671267967
Content-Type: multipart/alternative;
 boundary="----=_Part_11314_1655635135.1448671267967"

------=_Part_11314_1655635135.1448671267967
Content-Type: text/plain; charset=UTF-8



On Friday, November 27, 2015 at 2:12:00 PM UTC-5, Vicente J. Botet Escriba
wrote:

>
> namespace CNS {
>
>      concept bool C ....;
>
>      void f(C& c);
> };
>
> If type T is a model of concept C, would the following be well formed?
>
> T a;
> f(a);
>

You seem to be asking if concepts allow ADL if a type fulfilled the concept.

Remember, these declarations are declared to be equivalent (per 14.10.2):

void f(C &c);

template<typename T> requires C<T> //Needs () if `C` is a function
void f(T &c);

These declare the same function. Indeed, 14.10.2 goes on to express a
highly complex set of rules to explain exactly how this breaks down.

But in any case, applying a requires clause to a function does not affect
how it is looked up.

--

---
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_11314_1655635135.1448671267967
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><br><br>On Friday, November 27, 2015 at 2:12:00 PM UTC-5, =
Vicente J. Botet Escriba wrote:<br><blockquote class=3D"gmail_quote" style=
=3D"margin: 0;margin-left: 0.8ex;border-left: 1px #ccc solid;padding-left: =
1ex;">
<br>namespace CNS {
<br>
<br>=C2=A0 =C2=A0 =C2=A0concept bool C ....;
<br>
<br>=C2=A0 =C2=A0 =C2=A0void f(C&amp; c);
<br>};
<br>
<br>If type T is a model of concept C, would the following be well formed?
<br>
<br>T a;
<br>f(a);<br></blockquote><div><br>You seem to be asking if concepts allow =
ADL if a type fulfilled the concept.<br><br>Remember, these declarations ar=
e declared to be equivalent (per 14.10.2):<br><br><div class=3D"prettyprint=
" style=3D"background-color: rgb(250, 250, 250); border-color: rgb(187, 187=
, 187); border-style: solid; border-width: 1px; word-wrap: break-word;"><co=
de class=3D"prettyprint"><div class=3D"subprettyprint"><span style=3D"color=
: #008;" class=3D"styled-by-prettify">void</span><span style=3D"color: #000=
;" class=3D"styled-by-prettify"> f</span><span style=3D"color: #660;" class=
=3D"styled-by-prettify">(</span><span style=3D"color: #000;" class=3D"style=
d-by-prettify">C </span><span style=3D"color: #660;" class=3D"styled-by-pre=
ttify">&amp;</span><span style=3D"color: #000;" class=3D"styled-by-prettify=
">c</span><span style=3D"color: #660;" class=3D"styled-by-prettify">);</spa=
n><span style=3D"color: #000;" class=3D"styled-by-prettify"><br><br></span>=
<span style=3D"color: #008;" class=3D"styled-by-prettify">template</span><s=
pan style=3D"color: #660;" class=3D"styled-by-prettify">&lt;</span><span st=
yle=3D"color: #008;" class=3D"styled-by-prettify">typename</span><span styl=
e=3D"color: #000;" class=3D"styled-by-prettify"> T</span><span style=3D"col=
or: #660;" class=3D"styled-by-prettify">&gt;</span><span style=3D"color: #0=
00;" class=3D"styled-by-prettify"> requires C</span><span style=3D"color: #=
660;" class=3D"styled-by-prettify">&lt;</span><span style=3D"color: #000;" =
class=3D"styled-by-prettify">T</span><span style=3D"color: #660;" class=3D"=
styled-by-prettify">&gt;</span><span style=3D"color: #000;" class=3D"styled=
-by-prettify"> </span><span style=3D"color: #800;" class=3D"styled-by-prett=
ify">//Needs () if `C` is a function</span><span style=3D"color: #000;" cla=
ss=3D"styled-by-prettify"><br></span><span style=3D"color: #008;" class=3D"=
styled-by-prettify">void</span><span style=3D"color: #000;" class=3D"styled=
-by-prettify"> f</span><span style=3D"color: #660;" class=3D"styled-by-pret=
tify">(</span><span style=3D"color: #000;" class=3D"styled-by-prettify">T <=
/span><span style=3D"color: #660;" class=3D"styled-by-prettify">&amp;</span=
><span style=3D"color: #000;" class=3D"styled-by-prettify">c</span><span st=
yle=3D"color: #660;" class=3D"styled-by-prettify">);</span><span style=3D"c=
olor: #000;" class=3D"styled-by-prettify"><br></span></div></code></div><br=
>These declare the same function. Indeed, 14.10.2 goes on to express a high=
ly complex set of rules to explain exactly how this breaks down.<br><br></d=
iv>But in any case, applying a requires clause to a function does not affec=
t how it is looked up.<br><br></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_11314_1655635135.1448671267967--
------=_Part_11313_211198393.1448671267967--

.