From d4039c32cef5a57a64c789eb70b8905dd4d8eaa2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joaqu=C3=ADn=20M=2E=20L=C3=B3pez=20Mu=C3=B1oz?= Date: Mon, 31 May 2004 06:20:00 +0000 Subject: [PATCH] updated comments on int=0 disambiguators [SVN r22978] --- include/boost/multi_index/composite_key.hpp | 10 ++++++++++ include/boost/multi_index/identity.hpp | 10 +++++++--- include/boost/multi_index/mem_fun.hpp | 10 ++++++++++ include/boost/multi_index/member.hpp | 10 +++++++--- 4 files changed, 34 insertions(+), 6 deletions(-) diff --git a/include/boost/multi_index/composite_key.hpp b/include/boost/multi_index/composite_key.hpp index 2ea6c87..66042d6 100644 --- a/include/boost/multi_index/composite_key.hpp +++ b/include/boost/multi_index/composite_key.hpp @@ -531,6 +531,16 @@ struct composite_key_result /* composite_key */ +/* NB. Some overloads of operator() have an extra dummy parameter int=0. + * This disambiguator serves several purposes: + * - Without it, MSVC++ 6.0 incorrectly regards some overloads as + * specializations of a previous member function template. + * - MSVC++ 6.0/7.0 seem to incorrectly treat some different memfuns + * as if they have the same signature. + * - If remove_const is broken due to lack of PTS, int=0 avoids the + * declaration of memfuns with identical signature. + */ + template< typename Value, BOOST_MULTI_INDEX_CK_ENUM(BOOST_MULTI_INDEX_CK_TEMPLATE_PARM,KeyFromValue) diff --git a/include/boost/multi_index/identity.hpp b/include/boost/multi_index/identity.hpp index 6a375b8..509ac68 100644 --- a/include/boost/multi_index/identity.hpp +++ b/include/boost/multi_index/identity.hpp @@ -34,9 +34,13 @@ namespace detail{ */ /* NB. Some overloads of operator() have an extra dummy parameter int=0. - * This is so because MSVC++ 6.0 otherwise *incorrectly* regards these - * overloads as specializations of a previous member function template. - * Left for all compilers as it does no harm. + * This disambiguator serves several purposes: + * - Without it, MSVC++ 6.0 incorrectly regards some overloads as + * specializations of a previous member function template. + * - MSVC++ 6.0/7.0 seem to incorrectly treat some different memfuns + * as if they have the same signature. + * - If remove_const is broken due to lack of PTS, int=0 avoids the + * declaration of memfuns with identical signature. */ template diff --git a/include/boost/multi_index/mem_fun.hpp b/include/boost/multi_index/mem_fun.hpp index d083bd6..9ea90cc 100644 --- a/include/boost/multi_index/mem_fun.hpp +++ b/include/boost/multi_index/mem_fun.hpp @@ -30,6 +30,16 @@ namespace multi_index{ * arbitrary combinations of these (vg. T** or auto_ptr.) */ +/* NB. Some overloads of operator() have an extra dummy parameter int=0. + * This disambiguator serves several purposes: + * - Without it, MSVC++ 6.0 incorrectly regards some overloads as + * specializations of a previous member function template. + * - MSVC++ 6.0/7.0 seem to incorrectly treat some different memfuns + * as if they have the same signature. + * - If remove_const is broken due to lack of PTS, int=0 avoids the + * declaration of memfuns with identical signature. + */ + template struct const_mem_fun { diff --git a/include/boost/multi_index/member.hpp b/include/boost/multi_index/member.hpp index e30df53..52b274f 100644 --- a/include/boost/multi_index/member.hpp +++ b/include/boost/multi_index/member.hpp @@ -33,9 +33,13 @@ namespace detail{ */ /* NB. Some overloads of operator() have an extra dummy parameter int=0. - * This is so because MSVC++ 6.0 otherwise *incorrectly* regards these - * overloads as specializations of a previous member function template. - * Left for all compilers as it does no harm. + * This disambiguator serves several purposes: + * - Without it, MSVC++ 6.0 incorrectly regards some overloads as + * specializations of a previous member function template. + * - MSVC++ 6.0/7.0 seem to incorrectly treat some different memfuns + * as if they have the same signature. + * - If remove_const is broken due to lack of PTS, int=0 avoids the + * declaration of memfuns with identical signature. */ template