Opened 15 years ago

Closed 15 years ago

#1563 closed Feature Requests (fixed)

MS releases TR1 support Beta

Reported by: John Pavel jrp -at- dial -dot- pipex -dot- com Owned by: John Maddock
Milestone: Boost 1.35.0 Component: TR1
Version: Boost Development Trunk Severity: Optimization
Keywords: Cc: jrp@…

Description

Microsoft has released a feature pack for VS2008 that also includes an implementation of TR1, including features such as:

Smart pointers

Regular expression parsing

New containers (tuple, array, unordered set, etc)

Sophisticated random number generators

Polymorphic function wrappers

Type traits

(see http://www.microsoft.com/downloads/details.aspx?FamilyID=0d805d4e-2dc2-47c7-8818-a9f59de4cd9b&DisplayLang=en)

Can we put in the hooks necessary to recognise and use this pack, instead of the boost one, while running the boost tests? Indeed it would be good to be able to benchmark one tr1 implemantation against the other!

Attachments (2)

tr1.zip (21.6 KB ) - added by Richard Webb <Richard.Webb@…> 15 years ago.
TR1 test results
notr1.zip (10.8 KB ) - added by Richard Webb <Richard.Webb@…> 15 years ago.
TR1 test results with _HAS_TR1=0

Download all attachments as: .zip

Change History (8)

comment:1 by John Maddock, 15 years ago

Cc: jrp@… added
Status: newassigned

I'll look into this, in the mean time, if you can see any means of detecting when VC9 TR1 update has been installed, that would be a big help, John.

comment:2 by John Maddock, 15 years ago

Looking at this further, it appears that the version of VC9 I have doesn't support this beta, so I can't install it :-(

The documentation mentions the define _HAS_TR1, can you check to see if this gets defined to a non zero value after including <utility> or not?

Many thanks, John.

comment:3 by Richard Webb <richard.webb@…>, 15 years ago

THeres a

 #if !defined(_HAS_TR1)
  #define _HAS_TR1	1	/* enable TR1 extensions */
 #endif /* !defined(_HAS_TR1) */

in yvals.h, which is included as a result of including <utility> (amongst other things).

I tried changing the VC bit of tr1\detail\config.hpp to

#if _HAS_TR1
#  define BOOST_HAS_TR1_ARRAY
#  define BOOST_HAS_TR1_REFERENCE_WRAPPER
#  define BOOST_HAS_TR1_RESULT_OF
#  define BOOST_HAS_TR1_MEM_FN
#  define BOOST_HAS_TR1_BIND
#  define BOOST_HAS_TR1_FUNCTION
#  define BOOST_HAS_TR1_HASH
#  define BOOST_HAS_TR1_SHARED_PTR
#  define BOOST_HAS_TR1_RANDOM
#  define BOOST_HAS_TR1_REGEX
#  define BOOST_HAS_TR1_TUPLE
#  define BOOST_HAS_TR1_TYPE_TRAITS
#  define BOOST_HAS_TR1_UTILITY
#  define BOOST_HAS_TR1_UNORDERED_MAP
#  define BOOST_HAS_TR1_UNORDERED_SET
#else
#  define BOOST_HAS_TR1_HASH
#endif

And successfully called the MS versions of bind and shared_ptr (with the same code on VC8 still calling the Boost versions.) I havent tried any other libs yet.

comment:4 by John Maddock, 15 years ago

Can you try building the TR1 tests with this change?

And compare the results to the effect with _HAS_TR1=0 defined?

Thanks!

John.

by Richard Webb <Richard.Webb@…>, 15 years ago

Attachment: tr1.zip added

TR1 test results

by Richard Webb <Richard.Webb@…>, 15 years ago

Attachment: notr1.zip added

TR1 test results with _HAS_TR1=0

comment:5 by Richard Webb <Richard.Webb@…>, 15 years ago

Running the tests with _HAS_TR1=1 results in a lot of test failures, with some seemingly down to missing typedefs in the MS libs. e.g.

test_bind.cpp(33) : error C2039: 'result_type' : is not a member of 'std::tr1::_Bind<_Ret,_BindN>'

E:\BoostSVN\boost/regex/concepts.hpp(560) : error C2039: 'size_type' : is not a member of 'std::tr1::basic_regex<_Elem>'

test_hash.cpp(22) : error C2039: 'argument_type' : is not a member of 'std::tr1::hash<std::string>'

The docs that ship with the beta say that bind has some problems, but i don't know about the others.

Adding a <define>_HAS_TR1=0 to the test jamfile and then re-running the test gives the same results you get now without the beta (the MS version of hash gets included regardless of _HAS_TR1, so that still fails).

Building the current Trunk code with the beta results in loads of 'multiple declaration' errors, and my change removes all those.

See attached logs for more info

comment:6 by John Maddock, 15 years ago

Resolution: fixed
Status: assignedclosed

I've just committed your suggested patch: on the basis that VC9 + the feature pack will be unusable without it!

However, if there are any regressions in the release branch it'll just get yanked out I'm afraid :-(

Regards, John.

Note: See TracTickets for help on using tickets.