boost::system::error_code and std::error_code
Is there any plans to add a conversion operator from boost::error_code to std::error_code or alike? I was designing a class that I'd like to be usable pleasantly with boost variant of error_code and C++11 variant of error_code, but my design was getting rather complicated (multiple inheritance, templates with no type deduction, ...) and I give up after I came to the make_error_code function, which would be called by the error_code constructor if is_error_code_enum was specialized (which was) and we cannot overload function based on return type (then would be difficult to make it work with boost::system::error_code and std::error_code). TL;DR: What the plans for migration from boost::system::error_code to std::error_code? -- Vinícius dos Santos Oliveira https://about.me/vinipsmaker
Le 09/06/14 10:01, Vinícius dos Santos Oliveira a écrit :
Is there any plans to add a conversion operator from boost::error_code to std::error_code or alike? What about defining boost::system::error_code as std::error_code when available?
Vicente
I was designing a class that I'd like to be usable pleasantly with boost variant of error_code and C++11 variant of error_code, but my design was getting rather complicated (multiple inheritance, templates with no type deduction, ...) and I give up after I came to the make_error_code function, which would be called by the error_code constructor if is_error_code_enum was specialized (which was) and we cannot overload function based on return type (then would be difficult to make it work with boost::system::error_code and std::error_code).
TL;DR: What the plans for migration from boost::system::error_code to std::error_code?
2014-06-09 5:15 GMT-03:00 Vicente J. Botet Escriba : What about defining boost::system::error_code as std::error_code when
available? I think it's even better than a conversion operator, but it'd need to be a
careful task.
When you use custom types with error code, it's not very clear if the user
should define the functions in boost namespace or the user type namespace
(relying on dependent namespace lookup).
--
Vinícius dos Santos Oliveira
https://about.me/vinipsmaker
participants (2)
-
Vicente J. Botet Escriba
-
Vinícius dos Santos Oliveira