[MSVC7.0] functions missing when BOOST_NO_MEMBER_TEMPLATES is defined

Hi, All, As I am working to get libtorrent working on Win32 with MSVC 7.0, I notice that BOOST_NO_MEMBER_TEMPLATES is defined by default. As a consquence, some of the functions in multi_index_container.cpp is not defined. For example, #if !defined(BOOST_NO_MEMBER_TEMPLATES) template<int N> struct nth_index { BOOST_STATIC_ASSERT(N>=0&&N<mpl::size<index_type_list>::type::value); typedef typename mpl::at_c<index_type_list,N>::type type; }; template<int N> typename nth_index<N>::type& get(BOOST_EXPLICIT_TEMPLATE_NON_TYPE(int,N)) { BOOST_STATIC_ASSERT(N>=0&&N<mpl::size<index_type_list>::type::value); return *this; } template<int N> const typename nth_index<N>::type& get( BOOST_EXPLICIT_TEMPLATE_NON_TYPE(int,N))const { BOOST_STATIC_ASSERT(N>=0&&N<mpl::size<index_type_list>::type::value); return *this; } #endif Is there anything to enable these functions when BOOST_NO_MEMBER_TEMPLATES is undef? Any suggestions? Best regards, Allen Zhao

Allen Zhao wrote:
Is there anything to enable these functions when BOOST_NO_MEMBER_TEMPLATES is undef? Any suggestions?
Update your compiler. VC++7.0 cannot compile the code necessary to implement these, so it doesn't have them. The tools of VC++7.1 are freely available, so you could use those. Or get VC++8.0 Express; it's free, too. However, I believe the global version of get() should be available even on 7.0. You just can't use the member version. Sebastian Redl

Allen Zhao <xlz <at> gateway.unidocsys.com> writes:
Hi, All,
As I am working to get libtorrent working on Win32 with MSVC 7.0, I notice that BOOST_NO_MEMBER_TEMPLATES is defined by default. As a consquence, some of the functions in multi_index_container.cpp is not defined.
For example,
[...] The typedefs and member functions you refer to have global equivalents usable as replacements, as explained at http://boost.org/libs/multi_index/doc/compiler_specifics.html#msvc_70 Good luck with the porting, but take into account the compiler you're using is very old and broken and you might not succeed in the end. Check whether other Boost libs libtorrent depends on do work on MSVC 7.0. Also, if you include the name of the library in the subject line you sure will have more chances to get an answer. There are many posts in this and the developer list, and many authors won't read all the posts, but only those whose subject lines are connected to the libs they maintain. Best regards, Joaquín M López Muñoz Telefónica, Investigación y Desarrollo

Allen Zhao wrote:
Hi, All,
As I am working to get libtorrent working on Win32 with MSVC 7.0, I notice that BOOST_NO_MEMBER_TEMPLATES is defined by default. As a consquence, some of the functions in multi_index_container.cpp is not defined.
For example,
#if !defined(BOOST_NO_MEMBER_TEMPLATES)
You can try changing this to #if defined( BOOST_MSVC_MEMBER_TEMPLATES ) This macro is automatically defined on compilers that support member templates and MSVC 6.0/7.0.
template<int N> struct nth_index {
BOOST_STATIC_ASSERT(N>=0&&N<mpl::size<index_type_list>::type::value); typedef typename mpl::at_c<index_type_list,N>::type type; };

Peter Dimov ha escrito:
Allen Zhao wrote:
Hi, All,
As I am working to get libtorrent working on Win32 with MSVC 7.0, I notice that BOOST_NO_MEMBER_TEMPLATES is defined by default. As a consquence, some of the functions in multi_index_container.cpp is not defined.
For example,
#if !defined(BOOST_NO_MEMBER_TEMPLATES)
You can try changing this to
#if defined( BOOST_MSVC_MEMBER_TEMPLATES )
This macro is automatically defined on compilers that support member templates and MSVC 6.0/7.0.
No, no :) The guarded code really does not compile in MSVC 6.0/7.0, it's no overlook from my part. Best, Joaquín M López Muñoz Telefónica, Investigación y Desarrollo
participants (5)
-
Allen Zhao
-
Joaquin M Lopez Munoz
-
Joaquín Mª López Muñoz
-
Peter Dimov
-
Sebastian Redl