
Some months ago I proposed to include a defect macro to detect some defficiencies by several compilers regarding the ability to handle pointers to data members as template parameters. The name we came up with is BOOST_NO_POINTER_TO_MEMBER_TEMPLATE_PARAMETERS I include a little test case that successfully detects the bug in three out of the four compilers checked to show the problem * MSVC 6.5 (MSKB article ##249045), * MSVC 7.0 (***) * ICC 7.0/7.1 for Windows (support issue #207321), * VisualAge 6.0 for AIX (internal defect #288539.) The compiler marked with (***) does fail with the test, but only under certain compiler settings that I've not been able to isolate properly. When last discussed, it was argued that a new defect macro would only make sense if some lib needed it: now Boost.MultiIndex can take advantage of it (actually, the lib assumes the macro even if not currently supported by Boost.Config), and the problem has turned out to be more prevalent than the original MSVC-constrained case hinted at. Is it OK to add this to Boost.Config? Comment? Thank you, Joaquín M López Muñoz Telefónica, Investigación y Desarrollo *** BEGIN TEST CODE*** #include <iostream> struct pair { int x,y; pair(int x_,int y_):x(x_),y(y_){} }; template<int pair::* PtrToPairMember> struct foo { int bar(pair& p){return p.*PtrToPairMember;} }; int main() { pair p(0,1); foo<&pair::x> fx; foo<&pair::y> fy; if(fx.bar(p)!=0||fy.bar(p)!=1)std::cout<<"KO"<<std::endl; else std::cout<<"OK"<<std::endl; return 0; } ***END TEST CODE***

Joaquín Mª López Muñoz wrote:
The name we came up with is
BOOST_NO_POINTER_TO_MEMBER_TEMPLATE_PARAMETERS
I include a little test case that successfully detects the bug in three out of the four compilers checked to show the problem
I tested the following versions of GCC using your testcases, in both optimized and non-optimized mode: 2.95.3, 3.0.4, 3.2.3, 3.3.4, 3.4.0, 3.5.0-CVS. They all work correctly. So config/compiler/gcc.hpp does not need this macro. Thanks -- Giovanni Bajo

Some months ago I proposed to include a defect macro to detect some defficiencies by several compilers regarding the ability to handle pointers to data members as template parameters. The name we came up with is BOOST_NO_POINTER_TO_MEMBER_TEMPLATE_PARAMETERS I include a little test case that successfully detects the bug in three out of the four compilers checked to show the problem * MSVC 6.5 (MSKB article ##249045), * MSVC 7.0 (***) * ICC 7.0/7.1 for Windows (support issue #207321), * VisualAge 6.0 for AIX (internal defect #288539.) The compiler marked with (***) does fail with the test, but only under certain compiler settings that I've not been able to isolate properly. When last discussed, it was argued that a new defect macro would only make sense if some lib needed it: now Boost.MultiIndex can take advantage of it (actually, the lib assumes the macro even if not currently supported by Boost.Config), and the problem has turned out to be more prevalent than the original MSVC-constrained case hinted at. Is it OK to add this to Boost.Config? Comment? ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ OK, added as requested. John.

John Maddock ha escrito:
Some months ago I proposed to include a defect macro to detect some defficiencies by several compilers regarding the ability to handle pointers to data members as template parameters.
The name we came up with is
BOOST_NO_POINTER_TO_MEMBER_TEMPLATE_PARAMETERS
[...]
Is it OK to add this to Boost.Config? Comment?
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
OK, added as requested.
Fine, thanks! I'll be updating my docs to reflect this. Joaquín M López Muñoz Telefónica, Investigación y Desarrollo

On 6/22/04 10:13 AM, "Joaquín Mª López Muñoz" <joaquin@tid.es> wrote:
John Maddock ha escrito:
Some months ago I proposed to include a defect macro to detect some defficiencies by several compilers regarding the ability to handle pointers to data members as template parameters.
The name we came up with is
BOOST_NO_POINTER_TO_MEMBER_TEMPLATE_PARAMETERS
[...]
Is it OK to add this to Boost.Config? Comment?
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
OK, added as requested.
Fine, thanks! I'll be updating my docs to reflect this.
Shouldn't it be BOOST_NO_POINTER_TO_DATA_MEMBER_TEMPLATE_PARAMETERS instead? Or does it also apply to pointers-to-member-function? -- Daryle Walker Mac, Internet, and Video Game Junkie darylew AT hotmail DOT com

Daryle Walker ha escrito:
On 6/22/04 10:13 AM, "Joaquín Mª López Muñoz" <joaquin@tid.es> wrote:
John Maddock ha escrito:
Some months ago I proposed to include a defect macro to detect some defficiencies by several compilers regarding the ability to handle pointers to data members as template parameters.
The name we came up with is
BOOST_NO_POINTER_TO_MEMBER_TEMPLATE_PARAMETERS
[...]
Is it OK to add this to Boost.Config? Comment?
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
OK, added as requested.
Fine, thanks! I'll be updating my docs to reflect this.
Shouldn't it be BOOST_NO_POINTER_TO_DATA_MEMBER_TEMPLATE_PARAMETERS instead? Or does it also apply to pointers-to-member-function?
Umm, no, it only applies to pointers to data members. In my discharge, I'd say that the defect macro BOOST_NO_POINTER_TO_MEMBER_CONST only applies to pointers to member functions, and the name does not make it clear this, either. Anyway, I agree with you that your proposal is clearer. I'll stick to whatever is finally decided. Joaquín M López Muñoz Telefónica, Investigación y Desarrollo
participants (4)
-
Daryle Walker
-
Giovanni Bajo
-
Joaquín Mª López Muñoz
-
John Maddock