This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug libstdc++/39880] Specialisation is_error_code_enum<errc> should not exist
- From: "chris_kohlhoff at internet-mail dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 25 Apr 2009 11:03:31 -0000
- Subject: [Bug libstdc++/39880] Specialisation is_error_code_enum<errc> should not exist
- References: <bug-39880-17622@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #3 from chris_kohlhoff at internet-mail dot org 2009-04-25 11:03 -------
It's the intended behaviour that the conversion constructor and assignment
operator be disabled. That is, the std::errc type should not be implicitly
convertible to error_code, only to error_condition.
If users want to create an error_code from a std::errc then they can use
make_error_code():
error_code ec = make_error_code(errc::not_supported);
In a nutshell, ErrorConditionEnum concept means implicitly convertible to
error_condition but no implicit conversion to error_code. Likewise
ErrorCodeEnum means implicitly convertible to error_code but not to
error_condition.
(N.B. bugs 39881 and 39882 also have to be fixed to make this conversion work.)
--
chris_kohlhoff at internet-mail dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|WAITING |NEW
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39880