Re: [Boost-bugs] [Boost C++ Libraries] #1474: VC++ 2008 seems to trigger multiple inclusion of boost::hash

Subject: Re: [Boost-bugs] [Boost C++ Libraries] #1474: VC++ 2008 seems to trigger multiple inclusion of boost::hash
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2007-12-09 17:40:14


#1474: VC++ 2008 seems to trigger multiple inclusion of boost::hash
--------------------------------------------+-------------------------------
  Reporter: jrp at dial dot pipex dot com | Owner: johnmaddock
      Type: Bugs | Status: new
 Milestone: Boost 1.35.0 | Component: TR1
   Version: Boost Development Trunk | Severity: Problem
Resolution: | Keywords:
--------------------------------------------+-------------------------------
Comment (by Richard Webb <richard.webb_at_[hidden]>):

 I attempted to investigate this failure, and discovered that the
 <functional> shipped with VC9 actually defines a tr1::hash itself.
 Refer to <functional> line 869:

 {{{
 namespace tr1 { // always include std::tr1::hash for unordered_map/set
 ...
 }}}

 If i add a

 {{{
 #if defined(_MSC_VER) && (_MSC_VER >= 1500)
 # define BOOST_HAS_TR1_HASH
 #endif
 }}}

 to boost\tr1\detail\config.hpp then the code

 {{{
 #include <string>
 #include <boost/tr1/functional.hpp>

 int _tmain(int argc, _TCHAR* argv[])
 {
         std::string foo("foo");
         std::tr1::hash<std::string> hasher;
         size_t the_hash = hasher(foo);
         return 0;
 }
 }}}

 Compiles correctly and calls the MS hash function.

--
Ticket URL: <http://svn.boost.org/trac/boost/ticket/1474#comment:1>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.


This archive was generated by hypermail 2.1.7 : 2017-02-16 18:49:57 UTC