[config] Macro for "using" type alias defects
Hi all, I was wondering if there is any macro in Boost.Config for advertising the defect of the "using" support from the compiler. I was reported this: https://github.com/boostorg/test/pull/140 and at the time I wrote the thing, I thought that those guards would have been enough: https://github.com/boostorg/test/blob/35c9acf5bd38d625ebd45cf940c5b9a19aa229... (auto, tuple and variadic template sounds to me more difficult to support than "using" template alias). Would it make sense to have BOOST_NO_CXX11_TYPE_ALIAS? Thanks, Raffi
On 04/26/18 01:50, Raffi Enficiaud via Boost wrote:
Hi all,
I was wondering if there is any macro in Boost.Config for advertising the defect of the "using" support from the compiler.
I was reported this:
https://github.com/boostorg/test/pull/140
and at the time I wrote the thing, I thought that those guards would have been enough:
https://github.com/boostorg/test/blob/35c9acf5bd38d625ebd45cf940c5b9a19aa229...
(auto, tuple and variadic template sounds to me more difficult to support than "using" template alias).
Would it make sense to have BOOST_NO_CXX11_TYPE_ALIAS?
Why not just use a typedef? I would say, using a macro check would make the code less maintainable.
Le 26/04/2018 à 01:23, Andrey Semashev via Boost a écrit :
On 04/26/18 01:50, Raffi Enficiaud via Boost wrote:
Hi all,
I was wondering if there is any macro in Boost.Config for advertising the defect of the "using" support from the compiler.
I was reported this:
https://github.com/boostorg/test/pull/140
and at the time I wrote the thing, I thought that those guards would have been enough:
https://github.com/boostorg/test/blob/35c9acf5bd38d625ebd45cf940c5b9a19aa229...
(auto, tuple and variadic template sounds to me more difficult to support than "using" template alias).
Would it make sense to have BOOST_NO_CXX11_TYPE_ALIAS?
Why not just use a typedef?
I would say, using a macro check would make the code less maintainable.
It is not that I do not want your PR :) Here is why * the macro checks are already there, but apparently they did not capture all I needed. * the compiler advertises the support of several C++11 feature, but the support seams to be missing in other aspects. I would prefer removing this new feature of Boost.Test totally for such compilers as it may pull something else that I need to change, or mislead the users. * For a developer, typedef or using should be equivalent as this part of the code is C++11. Thanks! Raffi
On 04/26/18 09:14, Raffi Enficiaud via Boost wrote:
Le 26/04/2018 à 01:23, Andrey Semashev via Boost a écrit :
On 04/26/18 01:50, Raffi Enficiaud via Boost wrote:
Hi all,
I was wondering if there is any macro in Boost.Config for advertising the defect of the "using" support from the compiler.
I was reported this:
https://github.com/boostorg/test/pull/140
and at the time I wrote the thing, I thought that those guards would have been enough:
https://github.com/boostorg/test/blob/35c9acf5bd38d625ebd45cf940c5b9a19aa229...
(auto, tuple and variadic template sounds to me more difficult to support than "using" template alias).
Would it make sense to have BOOST_NO_CXX11_TYPE_ALIAS?
Why not just use a typedef?
I would say, using a macro check would make the code less maintainable.
It is not that I do not want your PR :)
I did not intend to advocate my PR, I really wanted to know the rationale for the new macro.
Here is why
* the macro checks are already there, but apparently they did not capture all I needed. * the compiler advertises the support of several C++11 feature, but the support seams to be missing in other aspects. I would prefer removing this new feature of Boost.Test totally for such compilers as it may pull something else that I need to change, or mislead the users. * For a developer, typedef or using should be equivalent as this part of the code is C++11.
Thanks.
Raffi Enficiaud wrote:
Hi all,
I was wondering if there is any macro in Boost.Config for advertising the defect of the "using" support from the compiler.
I was reported this:
https://github.com/boostorg/test/pull/140
and at the time I wrote the thing, I thought that those guards would have been enough:
https://github.com/boostorg/test/blob/35c9acf5bd38d625ebd45cf940c5b9a19aa229...
(auto, tuple and variadic template sounds to me more difficult to support than "using" template alias).
Would it make sense to have BOOST_NO_CXX11_TYPE_ALIAS?
As already stated in the issue, the macro is BOOST_NO_CXX11_TEMPLATE_ALIASES.
Le 26/04/2018 à 12:13, Peter Dimov via Boost a écrit :
Raffi Enficiaud wrote:
Hi all,
I was wondering if there is any macro in Boost.Config for advertising the defect of the "using" support from the compiler.
I was reported this:
https://github.com/boostorg/test/pull/140
and at the time I wrote the thing, I thought that those guards would have been enough:
https://github.com/boostorg/test/blob/35c9acf5bd38d625ebd45cf940c5b9a19aa229...
(auto, tuple and variadic template sounds to me more difficult to support than "using" template alias).
Would it make sense to have BOOST_NO_CXX11_TYPE_ALIAS?
As already stated in the issue, the macro is BOOST_NO_CXX11_TEMPLATE_ALIASES.
Good to know, but I thought this macro was for the second form of this (with templates): http://en.cppreference.com/w/cpp/language/type_alias You are stating that this is for the first form as well, which is called, to my understanding, "type alias". Is that correct? Thanks, Raffi
Raffi Enficiaud wrote:
Would it make sense to have BOOST_NO_CXX11_TYPE_ALIAS?
As already stated in the issue, the macro is BOOST_NO_CXX11_TEMPLATE_ALIASES.
Good to know, but I thought this macro was for the second form of this (with templates):
http://en.cppreference.com/w/cpp/language/type_alias
You are stating that this is for the first form as well, which is called, to my understanding, "type alias". Is that correct?
As far as I know, no compiler implements the non-template `using` separately from the template one, so for practical purposes, these are the same feature.
Le 26/04/2018 à 19:29, Peter Dimov via Boost a écrit :
Raffi Enficiaud wrote:
Would it make sense to have BOOST_NO_CXX11_TYPE_ALIAS?
As already stated in the issue, the macro is > BOOST_NO_CXX11_TEMPLATE_ALIASES.
Good to know, but I thought this macro was for the second form of this (with templates):
http://en.cppreference.com/w/cpp/language/type_alias
You are stating that this is for the first form as well, which is called, to my understanding, "type alias". Is that correct?
As far as I know, no compiler implements the non-template `using` separately from the template one, so for practical purposes, these are the same feature.
This was what I was indeed thinking when I guarded my code with auto, tuple and variadic templates availability (that "using" would just be there)... Let's try with what you are suggesting then. Raffi
participants (3)
-
Andrey Semashev
-
Peter Dimov
-
Raffi Enficiaud