Opened 15 years ago

Closed 15 years ago

Last modified 15 years ago

#1474 closed Bugs (fixed)

VC++ 2008 seems to trigger multiple inclusion of boost::hash

Reported by: jrp at dial dot pipex dot com Owned by: John Maddock
Milestone: Boost 1.35.0 Component: TR1
Version: Boost Development Trunk Severity: Problem
Keywords: Cc:

Description

C:\temp\regression\boost\boost/test/impl/execution_monitor.ipp(792) : warning C4535: calling _set_se_translator() requires /EHa
C:\temp\regression\boost\boost/tr1/functional.hpp(128) : error C2874: using-declaration causes a multiple declaration of 'boost::hash'
        C:\temp\regression\boost\boost/tr1/functional.hpp(124) : see declaration of 'boost::hash'

}}}

Change History (3)

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

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.

comment:2 by John Maddock, 15 years ago

Resolution: fixed
Status: newclosed

(In [41976]) Fixes #1474.

comment:3 by Eric Niebler, 15 years ago

(In [41984]) Merged revisions 41954-41983 via svnmerge from https://svn.boost.org/svn/boost/trunk

........

r41955 | schoepflin | 2007-12-10 05:40:56 -0800 (Mon, 10 Dec 2007) | 1 line

Treated Rogue Wave library concept check failure on Tru64/CXX.

........

r41956 | dave | 2007-12-10 07:19:21 -0800 (Mon, 10 Dec 2007) | 2 lines

SunPro 5.9 can't detect lvalue returns

........

r41957 | t_schwinger | 2007-12-10 10:26:38 -0800 (Mon, 10 Dec 2007) | 3 lines

changes msvc-7.1 to msvc-7.1*

........

r41966 | johnmaddock | 2007-12-11 08:37:22 -0800 (Tue, 11 Dec 2007) | 1 line

Fixes #1454.

........

r41968 | johnmaddock | 2007-12-11 09:16:21 -0800 (Tue, 11 Dec 2007) | 1 line

Fixes #1504.

........

r41970 | johnmaddock | 2007-12-11 09:19:03 -0800 (Tue, 11 Dec 2007) | 1 line

Fixes #1455.

........

r41973 | johnmaddock | 2007-12-11 09:28:15 -0800 (Tue, 11 Dec 2007) | 1 line

Fixes #1471.

........

r41976 | johnmaddock | 2007-12-11 10:51:57 -0800 (Tue, 11 Dec 2007) | 1 line

Fixes #1474.

........

r41979 | vladimir_prus | 2007-12-11 11:41:47 -0800 (Tue, 11 Dec 2007) | 1 line

Put add-usage-requirements back

........

r41980 | vladimir_prus | 2007-12-11 11:45:37 -0800 (Tue, 11 Dec 2007) | 1 line

Implement ISFILE for real

........

r41981 | vladimir_prus | 2007-12-11 11:46:19 -0800 (Tue, 11 Dec 2007) | 2 lines

When searching for headers, ignore directories, just like gcc does.

........

r41983 | bgubenko | 2007-12-11 12:43:11 -0800 (Tue, 11 Dec 2007) | 1 line

remove conditionalization for aCC: this header works with gcc on HP-UX also

........

Note: See TracTickets for help on using tickets.