Topic: Fleshing out std::ios_base::failure/std::io_errc


Author: Erich Keane <erich.keane@verizon.net>
Date: Mon, 21 Sep 2015 22:04:56 -0700 (PDT)
Raw View
------=_Part_1697_718643128.1442898296748
Content-Type: multipart/alternative;
 boundary="----=_Part_1698_736979398.1442898296748"

------=_Part_1698_736979398.1442898296748
Content-Type: text/plain; charset=UTF-8

One of the useful features that streams add is the ability to enable
exceptions, such that calls are then enabled permitted to throw.  This can
be extremely useful in situations such as using fstream to open a file.
After enabling the stream exceptions via std::ios_base::exceptions(...),
the streams will then throw an exception of type std::ios_base::failure
(which as of C++11 inherits from system_error).

All this is well and good, however the standard (std::io_errc) only
provides for the exception type std::io_errc::stream, which is a very
generic and meaningless exception.  As a result, the only way to get the
actual error out of a stream in the exception handler is to check errno().

And now the question:  I was wondering if there would be value/interest for
a proposal to add some subset of the errno definition to the std::io_errc
and require the variety of standardized streams to set sensible values for
std::ios_base::failure::error_code upon throwing?

Is this something that has already been proposed before?  Is there a reason
why the committee chose to leave this so un-fleshed-out when creating this
type for C++11?

--

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

<div dir=3D"ltr">One of the useful features that streams add is the ability=
 to enable exceptions, such that calls are then enabled permitted to throw.=
=C2=A0 This can be extremely useful in situations such as using fstream to =
open a file.=C2=A0 After enabling the stream exceptions via std::ios_base::=
exceptions(...), the streams will then throw an exception of type std::ios_=
base::failure (which as of C++11 inherits from system_error).<br><br>All th=
is is well and good, however the standard (std::io_errc) only provides for =
the exception type std::io_errc::stream, which is a very generic and meanin=
gless exception.=C2=A0 As a result, the only way to get the actual error ou=
t of a stream in the exception handler is to check errno().<br><br>And now =
the question:=C2=A0 I was wondering if there would be value/interest for a =
proposal to add some subset of the errno definition to the std::io_errc and=
 require the variety of standardized streams to set sensible values for std=
::ios_base::failure::error_code upon throwing?<br><br>Is this something tha=
t has already been proposed before?=C2=A0 Is there a reason why the committ=
ee chose to leave this so un-fleshed-out when creating this type for C++11?=
<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_1698_736979398.1442898296748--
------=_Part_1697_718643128.1442898296748--

.


Author: David Krauss <potswa@gmail.com>
Date: Tue, 22 Sep 2015 13:25:41 +0800
Raw View
--Apple-Mail=_262C181F-7ADD-4BA9-AC15-3A1D9CCC83CA
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain; charset=UTF-8


> On 2015=E2=80=9309=E2=80=9322, at 1:04 PM, Erich Keane <erich.keane@veriz=
on.net> wrote:
>=20
> All this is well and good, however the standard (std::io_errc) only provi=
des for the exception type std::io_errc::stream, which is a very generic an=
d meaningless exception.  As a result, the only way to get the actual error=
 out of a stream in the exception handler is to check errno().

std::ios_base::failure inherits std::system_error which takes an std::error=
_code defaulting to io_errc::stream.

The current standard says ([ios::failure] =C2=A727.5.3.1.1/2),

> When throwing ios_base::failure exceptions, implementations should provid=
e values of ec that identify the specific reason for the failure. [Note: Er=
rors arising from the operating system would typically be reported as syste=
m_category() errors with an error value of the error number reported by the=
 operating system. Errors arising from within the stream library would typi=
cally be reported as error_code(io_- errc::stream, iostream_category()). =
=E2=80=94 end note ]

=E2=80=94=E2=80=94=E2=80=94

> And now the question:  I was wondering if there would be value/interest f=
or a proposal to add some subset of the errno definition to the std::io_err=
c and require the variety of standardized streams to set sensible values fo=
r std::ios_base::failure::error_code upon throwing?


The values of errno are part of the C standard and imported into C++, but i=
t=E2=80=99s up to the OS and C stdlib implementation to apply them =E2=80=
=94 the C standard mostly only requires that some positive value is used in=
 certain cases.

Sensibility as far as guaranteeing that exc.code().value =3D=3D errno could=
 be a nice proposal, but you=E2=80=99d have to define specifically when tha=
t applies.

--=20

---=20
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 e=
mail 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-proposa=
ls/.

--Apple-Mail=_262C181F-7ADD-4BA9-AC15-3A1D9CCC83CA
Content-Transfer-Encoding: quoted-printable
Content-Type: text/html; charset=UTF-8

<html><head><meta http-equiv=3D"Content-Type" content=3D"text/html charset=
=3Dutf-8"></head><body style=3D"word-wrap: break-word; -webkit-nbsp-mode: s=
pace; -webkit-line-break: after-white-space;" class=3D""><br class=3D""><di=
v><blockquote type=3D"cite" class=3D""><div class=3D"">On 2015=E2=80=9309=
=E2=80=9322, at 1:04 PM, Erich Keane &lt;<a href=3D"mailto:erich.keane@veri=
zon.net" class=3D"">erich.keane@verizon.net</a>&gt; wrote:</div><br class=
=3D"Apple-interchange-newline"><div class=3D""><span style=3D"font-family: =
Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-=
weight: normal; letter-spacing: normal; line-height: normal; orphans: auto;=
 text-align: start; text-indent: 0px; text-transform: none; white-space: no=
rmal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; floa=
t: none; display: inline !important;" class=3D"">All this is well and good,=
 however the standard (std::io_errc) only provides for the exception type s=
td::io_errc::stream, which is a very generic and meaningless exception.&nbs=
p; As a result, the only way to get the actual error out of a stream in the=
 exception handler is to check errno().</span><br style=3D"font-family: Hel=
vetica; font-size: 12px; font-style: normal; font-variant: normal; font-wei=
ght: normal; letter-spacing: normal; line-height: normal; orphans: auto; te=
xt-align: start; text-indent: 0px; text-transform: none; white-space: norma=
l; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=
=3D""></div></blockquote></div><br class=3D""><div class=3D""><font face=3D=
"Courier" class=3D"">std::ios_base::failure</font> inherits <font face=3D"C=
ourier" class=3D"">std::system_error</font> which takes an <font face=3D"Co=
urier" class=3D"">std::error_code</font> <i class=3D"">defaulting</i>&nbsp;=
to <font face=3D"Courier" class=3D"">io_errc::stream</font>.</div><div clas=
s=3D""><br class=3D""></div><div class=3D"">The current standard says ([ios=
::failure] =C2=A727.5.3.1.1/2),</div><div class=3D""><br class=3D""></div><=
div class=3D""><div class=3D""><blockquote type=3D"cite" class=3D"">When th=
rowing&nbsp;ios_base::failure&nbsp;exceptions, implementations should provi=
de values of&nbsp;ec&nbsp;that identify&nbsp;the specific reason for the fa=
ilure. [Note:&nbsp;Errors arising from the operating system would typically=
&nbsp;be&nbsp;reported as&nbsp;system_category()&nbsp;errors with an error =
value of the error number reported by the operating&nbsp;system. Errors ari=
sing from within the stream library would typically be reported as&nbsp;err=
or_code(io_-&nbsp;errc::stream, iostream_category()).&nbsp;=E2=80=94 end no=
te&nbsp;]</blockquote></div></div><div class=3D"">=E2=80=94=E2=80=94=E2=80=
=94</div><div class=3D""><br class=3D""></div><div class=3D""><blockquote t=
ype=3D"cite" class=3D""><div class=3D"">And now the question:&nbsp; I was w=
ondering if there would be value/interest for a proposal to add some subset=
 of the errno definition to the std::io_errc and require the variety of sta=
ndardized streams to set sensible values for std::ios_base::failure::error_=
code upon throwing?</div></blockquote></div><div class=3D""><div class=3D""=
><span class=3D"" style=3D"float: none; display: inline !important;"><br cl=
ass=3D""></span></div></div><div class=3D""><span class=3D"" style=3D"float=
: none; display: inline !important;">The values of <font face=3D"Courier" c=
lass=3D"">errno</font> are part of the C standard and imported into C++, bu=
t it=E2=80=99s up to the OS and C stdlib implementation to apply them =E2=
=80=94 the C standard mostly only requires that some positive value is used=
 in certain cases.</span></div><div class=3D""><span class=3D"" style=3D"fl=
oat: none; display: inline !important;"><br class=3D""></span></div><div cl=
ass=3D""><span class=3D"" style=3D"float: none; display: inline !important;=
">Sensibility as far as guaranteeing that <font face=3D"Courier" class=3D""=
>exc.code().value =3D=3D errno</font> could be a nice proposal, but you=E2=
=80=99d have to define specifically when that applies.</span></div><div cla=
ss=3D""><span class=3D"" style=3D"float: none; display: inline !important;"=
><br class=3D""></span></div></body></html>

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

--Apple-Mail=_262C181F-7ADD-4BA9-AC15-3A1D9CCC83CA--

.


Author: Erich Keane <erich.keane@verizon.net>
Date: Mon, 21 Sep 2015 23:15:26 -0700 (PDT)
Raw View
------=_Part_457_270661959.1442902526319
Content-Type: multipart/alternative;
 boundary="----=_Part_458_1192778377.1442902526319"

------=_Part_458_1192778377.1442902526319
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable



On Monday, September 21, 2015 at 10:25:52 PM UTC-7, David Krauss wrote:
>
>
> On 2015=E2=80=9309=E2=80=9322, at 1:04 PM, Erich Keane <erich...@verizon.=
net <javascript:>>=20
> wrote:
>
> All this is well and good, however the standard (std::io_errc) only=20
> provides for the exception type std::io_errc::stream, which is a very=20
> generic and meaningless exception.  As a result, the only way to get the=
=20
> actual error out of a stream in the exception handler is to check errno()=
..
>
>
> std::ios_base::failure inherits std::system_error which takes an=20
> std::error_code *defaulting* to io_errc::stream.
>
> The current standard says ([ios::failure] =C2=A727.5.3.1.1/2),
>
> When throwing ios_base::failure exceptions, implementations should provid=
e=20
> values of ec that identify the specific reason for the failure.=20
> [Note: Errors arising from the operating system would typically be report=
ed=20
> as system_category() errors with an error value of the error number=20
> reported by the operating system. Errors arising from within the stream=
=20
> library would typically be reported as error_code(io_- errc::stream,=20
> iostream_category()). =E2=80=94 end note ]
>
> =E2=80=94=E2=80=94=E2=80=94
>

Thanks for the clarification!  The last time I had attempted this, I noted=
=20
that neither glibc or libc++ had implemented this with any meaningful=20
error_codes.  I JUST checked glibc version 2.21 (only 1 minor version old),=
=20
and note that they don't even implement the C++11 inherit from=20
system_error, so I suspect this is an area that isn't getting any=20
attention.  On each system that I've attempted it on, even the what() is=20
useless to tell.  For example, in my ifstream implementation, I simply get=
=20
a thrown failure with the 'what' equal to basic_ios::clear, no matter what=
=20
went wrong!

=20

>
> And now the question:  I was wondering if there would be value/interest=
=20
> for a proposal to add some subset of the errno definition to the=20
> std::io_errc and require the variety of standardized streams to set=20
> sensible values for std::ios_base::failure::error_code upon throwing?
>
>
> The values of errno are part of the C standard and imported into C++, but=
=20
> it=E2=80=99s up to the OS and C stdlib implementation to apply them =E2=
=80=94 the C=20
> standard mostly only requires that some positive value is used in certain=
=20
> cases.
>
> Sensibility as far as guaranteeing that exc.code().value =3D=3D errno cou=
ld=20
> be a nice proposal, but you=E2=80=99d have to define specifically when th=
at applies.
>
> Thanks again for the clarification. I guess what I mean is, using existin=
g=20
errno list-of-values as a starting point, would there be value in extending=
=20
std::io_errc to have much more specific values?  It would likely be=20
implementation defined to ensure that exec.code().value =3D=3D errno (unles=
s we=20
make the VALUES of the io_errc enum implementation defined), however it=20
would A Nice Thing to Have to be able to determine the cause of an=20
exception without resorting to errno (a C-ism that lacks in platform=20
independence).



--=20

---=20
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 e=
mail 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-proposa=
ls/.

------=_Part_458_1192778377.1442902526319
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<br><br>On Monday, September 21, 2015 at 10:25:52 PM UTC-7, David Krauss wr=
ote:<blockquote class=3D"gmail_quote" style=3D"margin: 0;margin-left: 0.8ex=
;border-left: 1px #ccc solid;padding-left: 1ex;"><div style=3D"word-wrap:br=
eak-word"><br><div><blockquote type=3D"cite"><div>On 2015=E2=80=9309=E2=80=
=9322, at 1:04 PM, Erich Keane &lt;<a href=3D"javascript:" target=3D"_blank=
" gdf-obfuscated-mailto=3D"ENM30STxBQAJ" rel=3D"nofollow" onmousedown=3D"th=
is.href=3D&#39;javascript:&#39;;return true;" onclick=3D"this.href=3D&#39;j=
avascript:&#39;;return true;">erich...@verizon.net</a>&gt; wrote:</div><br>=
<div><span style=3D"font-family:Helvetica;font-size:12px;font-style:normal;=
font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:no=
rmal;text-align:start;text-indent:0px;text-transform:none;white-space:norma=
l;word-spacing:0px;float:none;display:inline!important">All this is well an=
d good, however the standard (std::io_errc) only provides for the exception=
 type std::io_errc::stream, which is a very generic and meaningless excepti=
on.=C2=A0 As a result, the only way to get the actual error out of a stream=
 in the exception handler is to check errno().</span><br style=3D"font-fami=
ly:Helvetica;font-size:12px;font-style:normal;font-variant:normal;font-weig=
ht:normal;letter-spacing:normal;line-height:normal;text-align:start;text-in=
dent:0px;text-transform:none;white-space:normal;word-spacing:0px"></div></b=
lockquote></div><br><div><font face=3D"Courier">std::ios_base::failure</fon=
t> inherits <font face=3D"Courier">std::system_error</font> which takes an =
<font face=3D"Courier">std::error_code</font> <i>defaulting</i>=C2=A0to <fo=
nt face=3D"Courier">io_errc::stream</font>.</div><div><br></div><div>The cu=
rrent standard says ([ios::failure] =C2=A727.5.3.1.1/2),</div><div><br></di=
v><div><div><blockquote type=3D"cite">When throwing=C2=A0ios_base::failure=
=C2=A0<wbr>exceptions, implementations should provide values of=C2=A0ec=C2=
=A0that identify=C2=A0the specific reason for the failure. [Note:=C2=A0Erro=
rs arising from the operating system would typically=C2=A0be=C2=A0reported =
as=C2=A0system_category()=C2=A0errors with an error value of the error numb=
er reported by the operating=C2=A0system. Errors arising from within the st=
ream library would typically be reported as=C2=A0error_code(io_-=C2=A0errc:=
:<wbr>stream, iostream_category()).=C2=A0=E2=80=94 end note=C2=A0]</blockqu=
ote></div></div><div>=E2=80=94=E2=80=94=E2=80=94</div></div></blockquote><d=
iv><br>Thanks for the clarification!=C2=A0 The last time I had attempted th=
is, I noted that neither glibc or libc++ had implemented this with any mean=
ingful error_codes.=C2=A0 I JUST checked glibc version 2.21 (only 1 minor v=
ersion old), and note that they don&#39;t even implement the C++11 inherit =
from system_error, so I suspect this is an area that isn&#39;t getting any =
attention.=C2=A0 On each system that I&#39;ve attempted it on, even the wha=
t() is useless to tell.=C2=A0 For example, in my ifstream implementation, I=
 simply get a thrown failure with the &#39;what&#39; equal to basic_ios::cl=
ear, no matter what went wrong!<br><br>=C2=A0</div><blockquote class=3D"gma=
il_quote" style=3D"margin: 0;margin-left: 0.8ex;border-left: 1px #ccc solid=
;padding-left: 1ex;"><div style=3D"word-wrap:break-word"><div><br></div><di=
v><blockquote type=3D"cite"><div>And now the question:=C2=A0 I was wonderin=
g if there would be value/interest for a proposal to add some subset of the=
 errno definition to the std::io_errc and require the variety of standardiz=
ed streams to set sensible values for std::ios_base::failure::error_<wbr>co=
de upon throwing?</div></blockquote></div><div><div><span style=3D"float:no=
ne;display:inline!important"><br></span></div></div><div><span style=3D"flo=
at:none;display:inline!important">The values of <font face=3D"Courier">errn=
o</font> are part of the C standard and imported into C++, but it=E2=80=99s=
 up to the OS and C stdlib implementation to apply them =E2=80=94 the C sta=
ndard mostly only requires that some positive value is used in certain case=
s.</span></div><div><span style=3D"float:none;display:inline!important"><br=
></span></div><div><span style=3D"float:none;display:inline!important">Sens=
ibility as far as guaranteeing that <font face=3D"Courier">exc.code().value=
 =3D=3D errno</font> could be a nice proposal, but you=E2=80=99d have to de=
fine specifically when that applies.</span></div><div><span style=3D"float:=
none;display:inline!important"><br></span></div></div></blockquote><div>Tha=
nks again for the clarification. I guess what I mean is, using existing err=
no list-of-values as a starting point, would there be value in extending st=
d::io_errc to have much more specific values?=C2=A0 It would likely be impl=
ementation defined to ensure that exec.code().value =3D=3D errno (unless we=
 make the VALUES of the io_errc enum implementation defined), however it wo=
uld A Nice Thing to Have to be able to determine the cause of an exception =
without resorting to errno (a C-ism that lacks in platform independence).<b=
r><br><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_458_1192778377.1442902526319--
------=_Part_457_270661959.1442902526319--

.


Author: Ville Voutilainen <ville.voutilainen@gmail.com>
Date: Tue, 22 Sep 2015 09:21:56 +0300
Raw View
On 22 September 2015 at 09:15, Erich Keane <erich.keane@verizon.net> wrote:
>> std::ios_base::failure inherits std::system_error which takes an
>> std::error_code defaulting to io_errc::stream.
> Thanks for the clarification!  The last time I had attempted this, I noted
> that neither glibc or libc++ had implemented this with any meaningful
> error_codes.  I JUST checked glibc version 2.21 (only 1 minor version old),
> and note that they don't even implement the C++11 inherit from system_error,
> so I suspect this is an area that isn't getting any attention.  On each

glibc? libstdc++ versions corresponding to gcc 5 and gcc 6 do inherit
ios_base::failure
from system_error.

--

---
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: Erich Keane <erich.keane@verizon.net>
Date: Tue, 22 Sep 2015 07:45:50 -0700 (PDT)
Raw View
------=_Part_2243_797266430.1442933150607
Content-Type: multipart/alternative;
 boundary="----=_Part_2244_231139969.1442933150607"

------=_Part_2244_231139969.1442933150607
Content-Type: text/plain; charset=UTF-8



On Monday, September 21, 2015 at 11:22:00 PM UTC-7, Ville Voutilainen wrote:
>
> On 22 September 2015 at 09:15, Erich Keane <erich...@verizon.net
> <javascript:>> wrote:
> >> std::ios_base::failure inherits std::system_error which takes an
> >> std::error_code defaulting to io_errc::stream.
> > Thanks for the clarification!  The last time I had attempted this, I
> noted
> > that neither glibc or libc++ had implemented this with any meaningful
> > error_codes.  I JUST checked glibc version 2.21 (only 1 minor version
> old),
> > and note that they don't even implement the C++11 inherit from
> system_error,
> > so I suspect this is an area that isn't getting any attention.  On each
>
> glibc? libstdc++ versions corresponding to gcc 5 and gcc 6 do inherit
> ios_base::failure
> from system_error.
>

I have GCC 5.1.1 (shipped as default in Fedora 22), and
std::ios_base::failure has no member named 'code' according to the
compiler.  It should inherit this from system_error according to the
documentation I can find, but GCC it doesn't make 'code' available.

That said, it still doesn't have a different error code for OS interaction
errors.

--

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

<br><br>On Monday, September 21, 2015 at 11:22:00 PM UTC-7, Ville Voutilain=
en wrote:<blockquote class=3D"gmail_quote" style=3D"margin: 0;margin-left: =
0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;">On 22 September 2015 =
at 09:15, Erich Keane &lt;<a href=3D"javascript:" target=3D"_blank" gdf-obf=
uscated-mailto=3D"PEktHjX0BQAJ" rel=3D"nofollow" onmousedown=3D"this.href=
=3D&#39;javascript:&#39;;return true;" onclick=3D"this.href=3D&#39;javascri=
pt:&#39;;return true;">erich...@verizon.net</a>&gt; wrote:
<br>&gt;&gt; std::ios_base::failure inherits std::system_error which takes =
an
<br>&gt;&gt; std::error_code defaulting to io_errc::stream.
<br>&gt; Thanks for the clarification! =C2=A0The last time I had attempted =
this, I noted
<br>&gt; that neither glibc or libc++ had implemented this with any meaning=
ful
<br>&gt; error_codes. =C2=A0I JUST checked glibc version 2.21 (only 1 minor=
 version old),
<br>&gt; and note that they don&#39;t even implement the C++11 inherit from=
 system_error,
<br>&gt; so I suspect this is an area that isn&#39;t getting any attention.=
 =C2=A0On each
<br>
<br>glibc? libstdc++ versions corresponding to gcc 5 and gcc 6 do inherit
<br>ios_base::failure
<br>from system_error.
<br></blockquote><div><br>I have GCC 5.1.1 (shipped as default in Fedora 22=
), and std::ios_base::failure has no member named &#39;code&#39; according =
to the compiler.=C2=A0 It should inherit this from system_error according t=
o the documentation I can find, but GCC it doesn&#39;t make &#39;code&#39; =
available.<br><br>That said, it still doesn&#39;t have a different error co=
de for OS interaction errors. <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_2244_231139969.1442933150607--
------=_Part_2243_797266430.1442933150607--

.


Author: Ville Voutilainen <ville.voutilainen@gmail.com>
Date: Tue, 22 Sep 2015 17:51:15 +0300
Raw View
On 22 September 2015 at 17:45, Erich Keane <erich.keane@verizon.net> wrote:
>> glibc? libstdc++ versions corresponding to gcc 5 and gcc 6 do inherit
>> ios_base::failure
>> from system_error.
> I have GCC 5.1.1 (shipped as default in Fedora 22), and
> std::ios_base::failure has no member named 'code' according to the compiler.

Really?
http://melpon.org/wandbox/permlink/2DoS6BRF0nS95cEA

--

---
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: Erich Keane <erich.keane@verizon.net>
Date: Tue, 22 Sep 2015 13:35:57 -0700 (PDT)
Raw View
------=_Part_7003_1866675653.1442954157228
Content-Type: multipart/alternative;
 boundary="----=_Part_7004_1802348198.1442954157228"

------=_Part_7004_1802348198.1442954157228
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable



On Tuesday, September 22, 2015 at 7:51:17 AM UTC-7, Ville Voutilainen wrote=
:
>
> On 22 September 2015 at 17:45, Erich Keane <erich...@verizon.net=20
> <javascript:>> wrote:=20
> >> glibc? libstdc++ versions corresponding to gcc 5 and gcc 6 do inherit=
=20
> >> ios_base::failure=20
> >> from system_error.=20
> > I have GCC 5.1.1 (shipped as default in Fedora 22), and=20
> > std::ios_base::failure has no member named 'code' according to the=20
> compiler.=20
>
> Really?=20
> http://melpon.org/wandbox/permlink/2DoS6BRF0nS95cEA


Curious... I have my Fedora 22 box with what I believe is the same setup=20
(DNF says it is 5.1.1 library and compiler), and  get the following error=
=20
with what looks like the same build parameters.

"error: =E2=80=98class std::ios_base::failure=E2=80=99 has no member named =
=E2=80=98code=E2=80=99
     std::cout<< fail.code()<<std::endl;"

--=20

---=20
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 e=
mail 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-proposa=
ls/.

------=_Part_7004_1802348198.1442954157228
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<br><br>On Tuesday, September 22, 2015 at 7:51:17 AM UTC-7, Ville Voutilain=
en wrote:<blockquote class=3D"gmail_quote" style=3D"margin: 0;margin-left: =
0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;">On 22 September 2015 =
at 17:45, Erich Keane &lt;<a href=3D"javascript:" target=3D"_blank" gdf-obf=
uscated-mailto=3D"P7n5uf8PBgAJ" rel=3D"nofollow" onmousedown=3D"this.href=
=3D&#39;javascript:&#39;;return true;" onclick=3D"this.href=3D&#39;javascri=
pt:&#39;;return true;">erich...@verizon.net</a>&gt; wrote:
<br>&gt;&gt; glibc? libstdc++ versions corresponding to gcc 5 and gcc 6 do =
inherit
<br>&gt;&gt; ios_base::failure
<br>&gt;&gt; from system_error.
<br>&gt; I have GCC 5.1.1 (shipped as default in Fedora 22), and
<br>&gt; std::ios_base::failure has no member named &#39;code&#39; accordin=
g to the compiler.
<br>
<br>Really?
<br><a href=3D"http://melpon.org/wandbox/permlink/2DoS6BRF0nS95cEA" target=
=3D"_blank" rel=3D"nofollow" onmousedown=3D"this.href=3D&#39;http://www.goo=
gle.com/url?q\75http%3A%2F%2Fmelpon.org%2Fwandbox%2Fpermlink%2F2DoS6BRF0nS9=
5cEA\46sa\75D\46sntz\0751\46usg\75AFQjCNFhd59DR7j2JeLY8KWr4RA9PZAEUg&#39;;r=
eturn true;" onclick=3D"this.href=3D&#39;http://www.google.com/url?q\75http=
%3A%2F%2Fmelpon.org%2Fwandbox%2Fpermlink%2F2DoS6BRF0nS95cEA\46sa\75D\46sntz=
\0751\46usg\75AFQjCNFhd59DR7j2JeLY8KWr4RA9PZAEUg&#39;;return true;">http://=
melpon.org/wandbox/<wbr>permlink/2DoS6BRF0nS95cEA</a></blockquote><div><br>=
Curious... I have my Fedora 22 box with what I believe is the same setup (D=
NF says it is 5.1.1 library and compiler), and=C2=A0 get the following erro=
r with what looks like the same build parameters.<br><br>&quot;error: =E2=
=80=98class std::ios_base::failure=E2=80=99 has no member named =E2=80=98co=
de=E2=80=99<br>=C2=A0=C2=A0=C2=A0=C2=A0 std::cout&lt;&lt; fail.code()&lt;&l=
t;std::endl;&quot;<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_7004_1802348198.1442954157228--
------=_Part_7003_1866675653.1442954157228--

.


Author: Bo Persson <bop@gmb.dk>
Date: Tue, 22 Sep 2015 22:41:52 +0200
Raw View
On 2015-09-22 22:35, Erich Keane wrote:
>
>
> On Tuesday, September 22, 2015 at 7:51:17 AM UTC-7, Ville Voutilainen wro=
te:
>
>     On 22 September 2015 at 17:45, Erich Keane <erich...@verizon.net
>     <javascript:>> wrote:
>      >> glibc? libstdc++ versions corresponding to gcc 5 and gcc 6 do
>     inherit
>      >> ios_base::failure
>      >> from system_error.
>      > I have GCC 5.1.1 (shipped as default in Fedora 22), and
>      > std::ios_base::failure has no member named 'code' according to
>     the compiler.
>
>     Really?
>     http://melpon.org/wandbox/permlink/2DoS6BRF0nS95cEA
>     <http://melpon.org/wandbox/permlink/2DoS6BRF0nS95cEA>
>
>
> Curious... I have my Fedora 22 box with what I believe is the same setup
> (DNF says it is 5.1.1 library and compiler), and  get the following
> error with what looks like the same build parameters.
>
> "error: =E2=80=98class std::ios_base::failure=E2=80=99 has no member name=
d =E2=80=98code=E2=80=99
>       std::cout<< fail.code()<<std::endl;"
>

Just guessing: You two don't use the same -std=3D option when compiling.


Bo Persson



--=20

---=20
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 e=
mail 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-proposa=
ls/.

.


Author: Erich Keane <erich.keane@verizon.net>
Date: Tue, 22 Sep 2015 15:38:06 -0700 (PDT)
Raw View
------=_Part_7081_1565215680.1442961486580
Content-Type: text/plain; charset=UTF-8

I tried with 11, 14 and 1z. The site sent used 1z.

Either way, a bit of a digression from the proposed proposal :)

--

---
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_7081_1565215680.1442961486580--

.