Topic: Simplified/Extended syntax to import names onto
Author: iphone.javier.estrada@gmail.com
Date: Mon, 30 Apr 2018 07:20:40 -0700 (PDT)
Raw View
------=_Part_2709_1930740490.1525098040232
Content-Type: multipart/alternative;
boundary="----=_Part_2710_2045389961.1525098040233"
------=_Part_2710_2045389961.1525098040233
Content-Type: text/plain; charset="UTF-8"
Importing a name onto the current scope provides the following syntax:
#include <string>
#include <vector>
using std::string;
using std::vector;
or, alternatively:
using namespace std;
On one hand, you get selective (one at a time) control or an
all-or-nothing. Consider a more complicated program (this is reality for
many). Pick all of the following in one line or 10 lines:
#include <string>
#include <vector>
#include <tuple>
#include <utility>
#include <memory>
using std::string;
using std::vector;
using std::tuple;
using std::make_tuple;
using std::pair;
using std::make_pair;
using std::shared_ptr;
using std::make_shared;
using std::unique_ptr;
using std::make_unique;
You get the idea. That's a lot of fluff before you get to the crux of the
program.
* * *
This proposal is for the following simplified syntax (two alternatives).
1. Allow the use of a comma to separate each imported name. This is just a
simplified version that eliminates the multiple using statements, allowing
to separate the imported names with a comma.
#include <string>
#include <vector>
#include <tuple>
using std::vector, std::string, std::tuple, std::make_tuple;
or using different namespaces:
#include <string>
#include <vector>
#include <tuple>
#include <telephony.hpp> // declares multiple types within a telephony
namespace
using std::vector, std::string, std::tuple, std::make_tuple,
telephony::provider, telephony::address;
2. Enclose the imported names in curly braces.
#include <vector>
#include <string>
#include <tuple>
#include <iostream>
#include <chrono>
#include <telephony.hpp> // declares multiple types within a telephony
namespace
using std { vector, string, tuple, make_tuple, cout, endl };
using std::chrono { Monday, Tuesday, Wednesday, Thursday, Friday, Saturday,
Sunday };
using telephony { provider, address, terminal, connection,
terminal_connection };
Comments are welcome.
--
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.
To view this discussion on the web visit https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/1aa48b8a-35b6-415f-b105-6c50f1558188%40isocpp.org.
------=_Part_2710_2045389961.1525098040233
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr">Importing a name onto the current scope provides the follo=
wing syntax:<div><br></div><blockquote style=3D"margin: 0 0 0 40px; border:=
none; padding: 0px;"><div><font face=3D"courier new, monospace">#include &=
lt;string></font></div><div><font face=3D"courier new, monospace">#inclu=
de <vector></font></div><div><font face=3D"courier new, monospace"><b=
r></font></div><div><font face=3D"courier new, monospace">using std::string=
;</font></div><div><font face=3D"courier new, monospace">using std::vector;=
</font></div></blockquote><div><br></div><div>or, alternatively:</div><div>=
<br></div><blockquote style=3D"margin: 0 0 0 40px; border: none; padding: 0=
px;"><div><font face=3D"courier new, monospace">using namespace std;</font>=
</div></blockquote><div><br></div><div>On one hand, you get selective (one =
at a time) control or an all-or-nothing.=C2=A0 Consider a more complicated =
program (this is reality for many). Pick all of the following in one line o=
r 10 lines:</div><div><br></div><blockquote style=3D"margin: 0 0 0 40px; bo=
rder: none; padding: 0px;"><div><font face=3D"courier new, monospace">#incl=
ude <string></font></div><div><font face=3D"courier new, monospace">#=
include <vector></font></div><div><font face=3D"courier new, monospac=
e">#include <tuple></font></div><div><font face=3D"courier new, monos=
pace">#include <utility></font></div><div><font face=3D"courier new, =
monospace">#include <memory></font></div><div><font face=3D"courier n=
ew, monospace"><br></font></div><div><font face=3D"courier new, monospace">=
using std::string;</font></div><div><font face=3D"courier new, monospace">u=
sing std::vector;</font></div><div><font face=3D"courier new, monospace"><b=
r></font></div><div><font face=3D"courier new, monospace">using std::tuple;=
</font></div><div><font face=3D"courier new, monospace">using std::make_tup=
le;</font></div><div><font face=3D"courier new, monospace"><br></font></div=
><div><font face=3D"courier new, monospace">using std::pair;</font></div><d=
iv><font face=3D"courier new, monospace">using std::make_pair;</font></div>=
<div><font face=3D"courier new, monospace"><br></font></div><div><font face=
=3D"courier new, monospace">using std::shared_ptr;</font></div><div><font f=
ace=3D"courier new, monospace">using std::make_shared;</font></div><div><fo=
nt face=3D"courier new, monospace"><br></font></div><div><font face=3D"cour=
ier new, monospace">using std::unique_ptr;</font></div><div><font face=3D"c=
ourier new, monospace">using std::make_unique;</font></div></blockquote><di=
v><br></div><div><br></div><div>You get the idea. That's a lot of fluff=
before you get to the crux of the program.</div><div><br></div><div>* * *<=
/div><div><br></div><div>This proposal is for the following simplified synt=
ax (two alternatives).</div><div><br></div><div><br></div><div>1. Allow the=
use of a comma to separate each imported name.=C2=A0 This is just a simpli=
fied version that eliminates the multiple using statements, allowing to sep=
arate the imported names with a comma.</div><div><br></div><blockquote styl=
e=3D"margin: 0 0 0 40px; border: none; padding: 0px;"><div><font face=3D"co=
urier new, monospace">#include <string></font></div><div><font face=
=3D"courier new, monospace">#include <vector></font></div><div><span =
style=3D"font-family: "courier new", monospace;">#include <tup=
le></span>=C2=A0</div></blockquote><div>=C2=A0</div><blockquote style=3D=
"margin: 0 0 0 40px; border: none; padding: 0px;"><div><font face=3D"courie=
r new, monospace">using std::vector, std::string, std::tuple, std::make_tup=
le;</font></div></blockquote><div><br></div><div>or using different namespa=
ces:</div><div><br></div><blockquote style=3D"margin: 0 0 0 40px; border: n=
one; padding: 0px;"><div><font face=3D"courier new, monospace">#include <=
;string></font></div><div><font face=3D"courier new, monospace">#include=
<vector></font></div><div><span style=3D"font-family: "courier =
new", monospace;">#include <tuple></span>=C2=A0</div></blockquot=
e><div><br></div><blockquote style=3D"margin: 0 0 0 40px; border: none; pad=
ding: 0px;"><div><span style=3D"font-family: "courier new", monos=
pace;">#include <telephony.hpp> // declares multiple types within a t=
elephony namespace</span>=C2=A0</div></blockquote><div>=C2=A0</div><blockqu=
ote style=3D"margin: 0 0 0 40px; border: none; padding: 0px;"><div><font fa=
ce=3D"courier new, monospace">using std::vector, std::string, std::tuple, s=
td::make_tuple</font><span style=3D"font-family: "courier new", m=
onospace;">, telephony::provider, telephony::address;</span>=C2=A0</div></b=
lockquote><div><br></div><div>2. Enclose the imported names in curly braces=
..</div><div><br></div><blockquote style=3D"margin: 0 0 0 40px; border: none=
; padding: 0px;"><div><font face=3D"courier new, monospace">#include <ve=
ctor></font></div><div><font face=3D"courier new, monospace">#include &l=
t;string></font></div><div><font face=3D"courier new, monospace">#includ=
e <tuple></font></div><div><font face=3D"courier new, monospace">#inc=
lude <iostream></font></div></blockquote><blockquote style=3D"margin:=
0 0 0 40px; border: none; padding: 0px;"><div><span style=3D"font-family: =
"courier new", monospace;">#include <chrono></span>=C2=A0</=
div></blockquote><blockquote style=3D"margin: 0 0 0 40px; border: none; pad=
ding: 0px;"><div><font face=3D"courier new, monospace"><br></font></div><di=
v><font face=3D"courier new, monospace">#include <telephony.hpp> // d=
eclares multiple types within a telephony namespace</font></div></blockquot=
e><blockquote style=3D"margin: 0 0 0 40px; border: none; padding: 0px;"><br=
></blockquote><blockquote style=3D"margin: 0 0 0 40px; border: none; paddin=
g: 0px;"><div><font face=3D"courier new, monospace">using std { vector, str=
ing, tuple, make_tuple, cout, endl };</font></div></blockquote><blockquote =
style=3D"margin: 0 0 0 40px; border: none; padding: 0px;"><div><font face=
=3D"courier new, monospace">using std::chrono { Monday, Tuesday, Wednesday,=
Thursday, Friday, Saturday, Sunday };</font>=C2=A0</div></blockquote><bloc=
kquote style=3D"margin: 0 0 0 40px; border: none; padding: 0px;"><div><font=
face=3D"courier new, monospace">using telephony { provider, address, termi=
nal, connection, terminal_connection };</font></div></blockquote><div><br><=
/div><div><br></div><div><br></div><div>Comments are welcome.<br></div><div=
><br></div><div><br></div></div>
<p></p>
-- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals" 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 />
To view this discussion on the web visit <a href=3D"https://groups.google.c=
om/a/isocpp.org/d/msgid/std-proposals/1aa48b8a-35b6-415f-b105-6c50f1558188%=
40isocpp.org?utm_medium=3Demail&utm_source=3Dfooter">https://groups.google.=
com/a/isocpp.org/d/msgid/std-proposals/1aa48b8a-35b6-415f-b105-6c50f1558188=
%40isocpp.org</a>.<br />
------=_Part_2710_2045389961.1525098040233--
------=_Part_2709_1930740490.1525098040232--
.
Author: Ville Voutilainen <ville.voutilainen@gmail.com>
Date: Mon, 30 Apr 2018 17:24:03 +0300
Raw View
On 30 April 2018 at 17:20, <iphone.javier.estrada@gmail.com> wrote:
> 1. Allow the use of a comma to separate each imported name. This is just a
> simplified version that eliminates the multiple using statements, allowing
> to separate the imported names with a comma.
>
> #include <string>
> #include <vector>
> #include <tuple>
>
>
>
> using std::vector, std::string, std::tuple, std::make_tuple;
This program is valid C++17, so what you're asking for is already there.
--
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.
To view this discussion on the web visit https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/CAFk2RUZZ8O9JmEn4g1uy_V9Lsg4YNTAnDh5ur54Yo6CiuapOag%40mail.gmail.com.
.
Author: Barry Revzin <barry.revzin@gmail.com>
Date: Mon, 30 Apr 2018 07:46:54 -0700 (PDT)
Raw View
------=_Part_8570_1166056823.1525099614261
Content-Type: multipart/alternative;
boundary="----=_Part_8571_1075060980.1525099614261"
------=_Part_8571_1075060980.1525099614261
Content-Type: text/plain; charset="UTF-8"
On Monday, April 30, 2018 at 9:24:06 AM UTC-5, Ville Voutilainen wrote:
>
> On 30 April 2018 at 17:20, <iphone.jav...@gmail.com <javascript:>>
> wrote:
> > 1. Allow the use of a comma to separate each imported name. This is
> just a
> > simplified version that eliminates the multiple using statements,
> allowing
> > to separate the imported names with a comma.
> >
> > #include <string>
> > #include <vector>
> > #include <tuple>
> >
> >
> >
> > using std::vector, std::string, std::tuple, std::make_tuple;
>
> This program is valid C++17, so what you're asking for is already there.
>
As a result
of http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0195r2.html (in
case you were curious)
--
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.
To view this discussion on the web visit https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/5b419349-30e9-464a-aa43-f652c09ee339%40isocpp.org.
------=_Part_8571_1075060980.1525099614261
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr"><br><br>On Monday, April 30, 2018 at 9:24:06 AM UTC-5, Vil=
le Voutilainen wrote:<blockquote class=3D"gmail_quote" style=3D"margin: 0;m=
argin-left: 0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;">On 30 Apr=
il 2018 at 17:20, =C2=A0<<a href=3D"javascript:" target=3D"_blank" gdf-o=
bfuscated-mailto=3D"BibCGUPOBQAJ" rel=3D"nofollow" onmousedown=3D"this.href=
=3D'javascript:';return true;" onclick=3D"this.href=3D'javascri=
pt:';return true;">iphone.jav...@gmail.<wbr>com</a>> wrote:
<br>> 1. Allow the use of a comma to separate each imported name. =C2=A0=
This is just a
<br>> simplified version that eliminates the multiple using statements, =
allowing
<br>> to separate the imported names with a comma.
<br>>
<br>> #include <string>
<br>> #include <vector>
<br>> #include <tuple>
<br>>
<br>>
<br>>
<br>> using std::vector, std::string, std::tuple, std::make_tuple;
<br>
<br>This program is valid C++17, so what you're asking for is already t=
here.
<br></blockquote><div><br></div><div>As a result of=C2=A0http://www.open-st=
d.org/jtc1/sc22/wg21/docs/papers/2016/p0195r2.html (in case you were curiou=
s)=C2=A0</div></div>
<p></p>
-- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals" 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 />
To view this discussion on the web visit <a href=3D"https://groups.google.c=
om/a/isocpp.org/d/msgid/std-proposals/5b419349-30e9-464a-aa43-f652c09ee339%=
40isocpp.org?utm_medium=3Demail&utm_source=3Dfooter">https://groups.google.=
com/a/isocpp.org/d/msgid/std-proposals/5b419349-30e9-464a-aa43-f652c09ee339=
%40isocpp.org</a>.<br />
------=_Part_8571_1075060980.1525099614261--
------=_Part_8570_1166056823.1525099614261--
.
Author: Nicol Bolas <jmckesson@gmail.com>
Date: Mon, 30 Apr 2018 09:00:10 -0700 (PDT)
Raw View
------=_Part_10362_796416948.1525104010355
Content-Type: multipart/alternative;
boundary="----=_Part_10363_565355826.1525104010355"
------=_Part_10363_565355826.1525104010355
Content-Type: text/plain; charset="UTF-8"
Despite the fact that, as Ville pointed out, we can already do one of
those, I don't like the idea of putting all of those on different lines. It
makes it really hard to figure out what has been imported into the current
namespace and what has not.
It would be better to just stick `std::` in front of those names when you
use them. After all, you can't put `using std::vector` in a header (it
leaks to anything that includes it), so anytime a header needs to use
`std::vector`, that's how you have to spell it. Since a lot of code gets
put into headers, you're going to see `std::vector` and so forth a lot.
--
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.
To view this discussion on the web visit https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/3f9b9a05-4b78-40a2-960f-d05e8a84eb59%40isocpp.org.
------=_Part_10363_565355826.1525104010355
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr">Despite the fact that, as Ville pointed out, we can alread=
y do one of those, I don't like the idea of putting all of those on dif=
ferent lines. It makes it really hard to figure out what has been imported =
into the current namespace and what has not.<br><br>It would be better to j=
ust stick `std::` in front of those names when you use them. After all, you=
can't put `using std::vector` in a header (it leaks to anything that i=
ncludes it), so anytime a header needs to use `std::vector`, that's how=
you have to spell it. Since a lot of code gets put into headers, you'r=
e going to see `std::vector` and so forth a lot.<br></div>
<p></p>
-- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals" 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 />
To view this discussion on the web visit <a href=3D"https://groups.google.c=
om/a/isocpp.org/d/msgid/std-proposals/3f9b9a05-4b78-40a2-960f-d05e8a84eb59%=
40isocpp.org?utm_medium=3Demail&utm_source=3Dfooter">https://groups.google.=
com/a/isocpp.org/d/msgid/std-proposals/3f9b9a05-4b78-40a2-960f-d05e8a84eb59=
%40isocpp.org</a>.<br />
------=_Part_10363_565355826.1525104010355--
------=_Part_10362_796416948.1525104010355--
.
Author: iphone.javier.estrada@gmail.com
Date: Mon, 30 Apr 2018 09:12:18 -0700 (PDT)
Raw View
------=_Part_7066_197120781.1525104738709
Content-Type: multipart/alternative;
boundary="----=_Part_7067_1090316385.1525104738709"
------=_Part_7067_1090316385.1525104738709
Content-Type: text/plain; charset="UTF-8"
Hi, Ville,
You are correct for the first syntax.
On Monday, April 30, 2018 at 7:24:06 AM UTC-7, Ville Voutilainen wrote:
>
> On 30 April 2018 at 17:20, <iphone.jav...@gmail.com <javascript:>>
> wrote:
> > 1. Allow the use of a comma to separate each imported name. This is
> just a
> > simplified version that eliminates the multiple using statements,
> allowing
> > to separate the imported names with a comma.
> >
> > #include <string>
> > #include <vector>
> > #include <tuple>
> >
> >
> >
> > using std::vector, std::string, std::tuple, std::make_tuple;
>
> This program is valid C++17, so what you're asking for is already there.
>
--
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.
To view this discussion on the web visit https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/718f7edc-0653-4db8-b6f7-d16b95fa085f%40isocpp.org.
------=_Part_7067_1090316385.1525104738709
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr">Hi, Ville,<div><br></div><div>You are correct for the firs=
t syntax.<br><br>On Monday, April 30, 2018 at 7:24:06 AM UTC-7, Ville Vouti=
lainen wrote:<blockquote class=3D"gmail_quote" style=3D"margin: 0;margin-le=
ft: 0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;">On 30 April 2018 =
at 17:20, =C2=A0<<a href=3D"javascript:" target=3D"_blank" gdf-obfuscate=
d-mailto=3D"BibCGUPOBQAJ" rel=3D"nofollow" onmousedown=3D"this.href=3D'=
javascript:';return true;" onclick=3D"this.href=3D'javascript:'=
;return true;">iphone.jav...@gmail.<wbr>com</a>> wrote:
<br>> 1. Allow the use of a comma to separate each imported name. =C2=A0=
This is just a
<br>> simplified version that eliminates the multiple using statements, =
allowing
<br>> to separate the imported names with a comma.
<br>>
<br>> #include <string>
<br>> #include <vector>
<br>> #include <tuple>
<br>>
<br>>
<br>>
<br>> using std::vector, std::string, std::tuple, std::make_tuple;
<br>
<br>This program is valid C++17, so what you're asking for is already t=
here.
<br></blockquote></div></div>
<p></p>
-- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals" 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 />
To view this discussion on the web visit <a href=3D"https://groups.google.c=
om/a/isocpp.org/d/msgid/std-proposals/718f7edc-0653-4db8-b6f7-d16b95fa085f%=
40isocpp.org?utm_medium=3Demail&utm_source=3Dfooter">https://groups.google.=
com/a/isocpp.org/d/msgid/std-proposals/718f7edc-0653-4db8-b6f7-d16b95fa085f=
%40isocpp.org</a>.<br />
------=_Part_7067_1090316385.1525104738709--
------=_Part_7066_197120781.1525104738709--
.
Author: Nicol Bolas <jmckesson@gmail.com>
Date: Mon, 30 Apr 2018 11:00:12 -0700 (PDT)
Raw View
------=_Part_2530_2084193051.1525111212351
Content-Type: multipart/alternative;
boundary="----=_Part_2531_47331924.1525111212351"
------=_Part_2531_47331924.1525111212351
Content-Type: text/plain; charset="UTF-8"
On Monday, April 30, 2018 at 12:00:10 PM UTC-4, Nicol Bolas wrote:
>
> Despite the fact that, as Ville pointed out, we can already do one of
> those, I don't like the idea of putting all of those on different lines. It
> makes it really hard to figure out what has been imported into the current
> namespace and what has not.
>
> It would be better to just stick `std::` in front of those names when you
> use them. After all, you can't put `using std::vector` in a header (it
> leaks to anything that includes it), so anytime a header needs to use
> `std::vector`, that's how you have to spell it. Since a lot of code gets
> put into headers, you're going to see `std::vector` and so forth a lot.
>
Two things. First, I meant "on the same lines" not "on different lines".
Second, with the advent of modules, we may be heading towards a future
where `using identifier;` starts becoming much more commonplace. We avoid
`using` declarations in headers only because we need to avoid leaking. And
since all template code has to be in headers, lots of C++ gets written
there. Since we're already used to `std::vector` in our headers, it often
isn't worth the effort to put `using std::vector` in our source files.
But with modules, leaking isn't possible, so `using` declarations are far
more reasonable. In such a system, it's now much more reasonable to have
some preamble that invokes `using` for a bunch of names that will be
commonly used. Even `using namespace *` might start being reasonable in
such circumstances.
Given that, a way to shorten that preamble in terms of length might be
appropriate. Of course, we already have that in C++17, so... there we are ;)
--
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.
To view this discussion on the web visit https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/7658590c-7be0-4d65-8593-20ff75996096%40isocpp.org.
------=_Part_2531_47331924.1525111212351
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr">On Monday, April 30, 2018 at 12:00:10 PM UTC-4, Nicol Bola=
s wrote:<blockquote class=3D"gmail_quote" style=3D"margin: 0;margin-left: 0=
..8ex;border-left: 1px #ccc solid;padding-left: 1ex;"><div dir=3D"ltr">Despi=
te the fact that, as Ville pointed out, we can already do one of those, I d=
on't like the idea of putting all of those on different lines. It makes=
it really hard to figure out what has been imported into the current names=
pace and what has not.<br><br>It would be better to just stick `std::` in f=
ront of those names when you use them. After all, you can't put `using =
std::vector` in a header (it leaks to anything that includes it), so anytim=
e a header needs to use `std::vector`, that's how you have to spell it.=
Since a lot of code gets put into headers, you're going to see `std::v=
ector` and so forth a lot.<br></div></blockquote><div><br>Two things. First=
, I meant "on the same lines" not "on different lines".=
<br><br>Second, with the advent of modules, we may be heading towards a fut=
ure where `using identifier;` starts becoming much more commonplace. We avo=
id `using` declarations in headers only because we need to avoid leaking. A=
nd since all template code has to be in headers, lots of C++ gets written t=
here. Since we're already used to `std::vector` in our headers, it ofte=
n isn't worth the effort to put `using std::vector` in our source files=
..<br><br>But with modules, leaking isn't possible, so `using` declarati=
ons are far more reasonable. In such a system, it's now much more reaso=
nable to have some preamble that invokes `using` for a bunch of names that =
will be commonly used. Even `using namespace *` might start being reasonabl=
e in such circumstances.<br><br>Given that, a way to shorten that preamble =
in terms of length might be appropriate. Of course, we already have that in=
C++17, so... there we are ;)<br></div></div>
<p></p>
-- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals" 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 />
To view this discussion on the web visit <a href=3D"https://groups.google.c=
om/a/isocpp.org/d/msgid/std-proposals/7658590c-7be0-4d65-8593-20ff75996096%=
40isocpp.org?utm_medium=3Demail&utm_source=3Dfooter">https://groups.google.=
com/a/isocpp.org/d/msgid/std-proposals/7658590c-7be0-4d65-8593-20ff75996096=
%40isocpp.org</a>.<br />
------=_Part_2531_47331924.1525111212351--
------=_Part_2530_2084193051.1525111212351--
.