From 71790af7f6d242e18c1ae310d884efcf9a5efea9 Mon Sep 17 00:00:00 2001 From: Dave Abrahams Date: Thu, 4 Oct 2001 19:56:07 +0000 Subject: [PATCH] Changed name of "bind" to "select" to avoid problems with MSVC. [SVN r11338] --- .../boost/detail/named_template_params.hpp | 31 +++++++++++-------- 1 file changed, 18 insertions(+), 13 deletions(-) diff --git a/include/boost/detail/named_template_params.hpp b/include/boost/detail/named_template_params.hpp index 7786bde..2af39cc 100644 --- a/include/boost/detail/named_template_params.hpp +++ b/include/boost/detail/named_template_params.hpp @@ -4,6 +4,11 @@ // "as is" without express or implied warranty, and with no claim as // to its suitability for any purpose. +// Revision History: + +// 04 Oct 2001 David Abrahams +// Changed name of "bind" to "select" to avoid problems with MSVC. + #ifndef BOOST_DETAIL_NAMED_TEMPLATE_PARAMS_HPP #define BOOST_DETAIL_NAMED_TEMPLATE_PARAMS_HPP @@ -20,7 +25,7 @@ namespace boost { struct dummy_default_gen { template - struct bind { + struct select { typedef default_argument type; }; }; @@ -41,14 +46,14 @@ namespace boost { struct choose_default { template - struct bind { + struct select { typedef typename default_generator::type Gen; - typedef typename Gen::template bind::type type; + typedef typename Gen::template select::type type; }; }; struct choose_arg { template - struct bind { + struct select { typedef Arg type; }; }; @@ -81,7 +86,7 @@ namespace boost { #endif public: typedef typename Selector - ::template bind::type type; + ::template select::type type; }; // To differentiate an unnamed parameter from a traits generator @@ -94,10 +99,10 @@ namespace boost { }; struct choose_named_params { - template struct bind { typedef Prev type; }; + template struct select { typedef Prev type; }; }; struct choose_default_arg { - template struct bind { + template struct select { typedef detail::default_argument type; }; }; @@ -117,15 +122,15 @@ namespace boost { struct choose_default_argument { enum { is_named = is_named_param_list::value }; typedef typename choose_default_dispatch::type Selector; - typedef typename Selector::template bind::type type; + typedef typename Selector::template select::type type; }; // This macro assumes that there is a class named default_##TYPE // defined before the application of the macro. This class should - // have a single member class template named "bind" with two + // have a single member class template named "select" with two // template parameters: the type of the class being created (e.g., // the iterator_adaptor type when creating iterator adaptors) and - // a traits class. The bind class should have a single typedef + // a traits class. The select class should have a single typedef // named "type" that produces the default for TYPE. See // boost/iterator_adaptors.hpp for an example usage. Also, // applications of this macro must be placed in namespace @@ -134,7 +139,7 @@ namespace boost { #define BOOST_NAMED_TEMPLATE_PARAM(TYPE) \ struct get_##TYPE##_from_named { \ template \ - struct bind { \ + struct select { \ typedef typename NamedParams::traits NamedTraits; \ typedef typename NamedTraits::TYPE TYPE; \ typedef typename resolve_default struct bind { \ + template struct select { \ typedef typename resolve_default::type type; \ };\ @@ -160,7 +165,7 @@ namespace boost { enum { is_named = is_named_param_list::value }; \ typedef typename get_##TYPE##_dispatch::type Selector; \ public: \ - typedef typename Selector::template bind::type type; \ + typedef typename Selector::template select::type type; \ }; \ template <> struct default_generator { \ typedef default_##TYPE type; \