noexcept BOOST_EXPLICIT_OPERATOR_BOOL
Hi, Although I am not entirely convinced that any not throwing function (except for moves) should be marked as noexcept, I can see that noexcept starts to get into Boost. explicit operator bool appears to be a good candidate, but macro BOOST_EXPLICIT_OPERATOR_BOOL does not offer it. So I have to choose: use the macro or noexcept. Perhaps the macro could be expanded to give an option to add noexcept, but that would spawn two macros (BOOST_EXPLICIT_OPERATOR_BOOL and BOOST_CONSTEXPR_EXPLICIT_OPERATOR_BOOL) into four. Are four macros for almost the same purpose acceptable? Or do I have to abandon the idea of making the operator noeaxcept. Are there any recommendations? Regards, &rzej
On Friday 25 April 2014 17:09:03 Andrzej Krzemienski wrote:
Hi, Although I am not entirely convinced that any not throwing function (except for moves) should be marked as noexcept, I can see that noexcept starts to get into Boost. explicit operator bool appears to be a good candidate, but macro BOOST_EXPLICIT_OPERATOR_BOOL does not offer it. So I have to choose: use the macro or noexcept.
Perhaps the macro could be expanded to give an option to add noexcept, but that would spawn two macros (BOOST_EXPLICIT_OPERATOR_BOOL and BOOST_CONSTEXPR_EXPLICIT_OPERATOR_BOOL) into four.
Are four macros for almost the same purpose acceptable? Or do I have to abandon the idea of making the operator noeaxcept. Are there any recommendations?
I think, noexcept could be added to the existing macros rather safely using BOOST_NOEXCEPT_IF/BOOST_NOEXCEPT_EXPR. I could do it if no one objects.
2014-04-25 17:15 GMT+02:00 Andrey Semashev
On Friday 25 April 2014 17:09:03 Andrzej Krzemienski wrote:
Hi, Although I am not entirely convinced that any not throwing function (except for moves) should be marked as noexcept, I can see that noexcept starts to get into Boost. explicit operator bool appears to be a good candidate, but macro BOOST_EXPLICIT_OPERATOR_BOOL does not offer it. So I have to choose: use the macro or noexcept.
Perhaps the macro could be expanded to give an option to add noexcept, but that would spawn two macros (BOOST_EXPLICIT_OPERATOR_BOOL and BOOST_CONSTEXPR_EXPLICIT_OPERATOR_BOOL) into four.
Are four macros for almost the same purpose acceptable? Or do I have to abandon the idea of making the operator noeaxcept. Are there any recommendations?
I think, noexcept could be added to the existing macros rather safely using BOOST_NOEXCEPT_IF/BOOST_NOEXCEPT_EXPR. I could do it if no one objects.
Yes, make it noexcept if operator! is noexcept. That couldn't possibly hurt anyone.
On Friday 25 April 2014 20:21:03 Andrzej Krzemienski wrote:
2014-04-25 17:15 GMT+02:00 Andrey Semashev
: I think, noexcept could be added to the existing macros rather safely using BOOST_NOEXCEPT_IF/BOOST_NOEXCEPT_EXPR. I could do it if no one objects.
Yes, make it noexcept if operator! is noexcept. That couldn't possibly hurt anyone.
Hmm, I forgot that the noexcept argument requires the enclosing class type. I cannot use 'this' to deduce the type, so it seems to be not possible to implement with the current interface. The good news is that the constexpr version is implicitly noexcept already.
Does it make sense then to add yet another macro?
(BOOST_NOEXCEPT_EXPLICIT_OPERATOR_BOOL)
2014-04-25 22:23 GMT+02:00 Andrey Semashev
On Friday 25 April 2014 20:21:03 Andrzej Krzemienski wrote:
2014-04-25 17:15 GMT+02:00 Andrey Semashev
: I think, noexcept could be added to the existing macros rather safely using BOOST_NOEXCEPT_IF/BOOST_NOEXCEPT_EXPR. I could do it if no one objects.
Yes, make it noexcept if operator! is noexcept. That couldn't possibly hurt anyone.
Hmm, I forgot that the noexcept argument requires the enclosing class type. I cannot use 'this' to deduce the type, so it seems to be not possible to implement with the current interface. The good news is that the constexpr version is implicitly noexcept already.
_______________________________________________ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
On Friday 25 April 2014 23:14:54 Andrzej Krzemienski wrote:
2014-04-25 22:23 GMT+02:00 Andrey Semashev
: On Friday 25 April 2014 20:21:03 Andrzej Krzemienski wrote:
2014-04-25 17:15 GMT+02:00 Andrey Semashev
: I think, noexcept could be added to the existing macros rather safely using BOOST_NOEXCEPT_IF/BOOST_NOEXCEPT_EXPR. I could do it if no one objects.
Yes, make it noexcept if operator! is noexcept. That couldn't possibly
hurt
anyone.
Hmm, I forgot that the noexcept argument requires the enclosing class type. I cannot use 'this' to deduce the type, so it seems to be not possible to implement with the current interface. The good news is that the constexpr version is implicitly noexcept already.
Does it make sense then to add yet another macro? (BOOST_NOEXCEPT_EXPLICIT_OPERATOR_BOOL)
A new macro sounds reasonable.
On Saturday 26 April 2014 14:42:40 you wrote:
On Friday 25 April 2014 23:14:54 Andrzej Krzemienski wrote:
2014-04-25 22:23 GMT+02:00 Andrey Semashev
: On Friday 25 April 2014 20:21:03 Andrzej Krzemienski wrote:
2014-04-25 17:15 GMT+02:00 Andrey Semashev
: I think, noexcept could be added to the existing macros rather safely using BOOST_NOEXCEPT_IF/BOOST_NOEXCEPT_EXPR. I could do it if no one objects.
Yes, make it noexcept if operator! is noexcept. That couldn't possibly
hurt
anyone.
Hmm, I forgot that the noexcept argument requires the enclosing class type. I cannot use 'this' to deduce the type, so it seems to be not possible to implement with the current interface. The good news is that the constexpr version is implicitly noexcept already.
Does it make sense then to add yet another macro? (BOOST_NOEXCEPT_EXPLICIT_OPERATOR_BOOL)
A new macro sounds reasonable.
participants (2)
-
Andrey Semashev
-
Andrzej Krzemienski