|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r69626 - in branches/release: boost/tr1 boost/tr1/detail libs/tr1 libs/tr1/doc libs/tr1/test
From: john_at_[hidden]
Date: 2011-03-07 11:43:49
Author: johnmaddock
Date: 2011-03-07 11:43:45 EST (Mon, 07 Mar 2011)
New Revision: 69626
URL: http://svn.boost.org/trac/boost/changeset/69626
Log:
Merge minor fixes in TR1 to release.
Properties modified:
branches/release/boost/tr1/ (props changed)
branches/release/libs/tr1/ (props changed)
Text files modified:
branches/release/boost/tr1/detail/config_all.hpp | 5 +++++
branches/release/boost/tr1/functional.hpp | 7 ++++++-
branches/release/libs/tr1/doc/tr1.qbk | 5 +++++
branches/release/libs/tr1/test/test_cmath.cpp | 6 ++++--
branches/release/libs/tr1/test/test_hash.cpp | 25 ++++++++++++++++++++++++-
5 files changed, 44 insertions(+), 4 deletions(-)
Modified: branches/release/boost/tr1/detail/config_all.hpp
==============================================================================
--- branches/release/boost/tr1/detail/config_all.hpp (original)
+++ branches/release/boost/tr1/detail/config_all.hpp 2011-03-07 11:43:45 EST (Mon, 07 Mar 2011)
@@ -63,6 +63,11 @@
# else
# define BOOST_TR1_STD_HEADER(name) <../stlport/name>
# endif
+# elif defined(__PATHSCALE__) && (defined(__STD_RWCOMPILER_H__) || defined(_RWSTD_VER))
+# define BOOST_TR1_STD_HEADER(name) <../include/name>
+
+# elif defined(__SUNPRO_CC) && (defined(__STD_RWCOMPILER_H__) || defined(_RWSTD_VER))
+# define BOOST_TR1_STD_HEADER(name) <../stdcxx4/name>
# elif defined(__HP_aCC)
// HP aCC include path:
Modified: branches/release/boost/tr1/functional.hpp
==============================================================================
--- branches/release/boost/tr1/functional.hpp (original)
+++ branches/release/boost/tr1/functional.hpp 2011-03-07 11:43:45 EST (Mon, 07 Mar 2011)
@@ -128,7 +128,12 @@
}
namespace std{ namespace tr1{
- using ::boost::hash;
+ //using ::boost::hash;
+
+ template <class T>
+ struct hash : public boost::hash<T>
+ {
+ };
}}
Modified: branches/release/libs/tr1/doc/tr1.qbk
==============================================================================
--- branches/release/libs/tr1/doc/tr1.qbk (original)
+++ branches/release/libs/tr1/doc/tr1.qbk 2011-03-07 11:43:45 EST (Mon, 07 Mar 2011)
@@ -1010,6 +1010,11 @@
in the [@http://www.open-std.org/JTC1/SC22/WG21/docs/papers/2005/n1756.pdf
Library Extension Technical Report Issues List].
+[note There are portability issues with this template - in particular the `hash` template
+might not actually be defined inside namespace std::tr1, making user-defined specializations
+of the template non-portable. For example Visual C++ 2010 defines `hash` in namespace `std`
+and then imports this into `std::tr1` with a using declaration.]
+
[endsect]
[section:regex Regular Expressions.]
Modified: branches/release/libs/tr1/test/test_cmath.cpp
==============================================================================
--- branches/release/libs/tr1/test/test_cmath.cpp (original)
+++ branches/release/libs/tr1/test/test_cmath.cpp 2011-03-07 11:43:45 EST (Mon, 07 Mar 2011)
@@ -172,9 +172,11 @@
verify_return_type((std::tr1::nextafter)(ld, ld), ld);
verify_return_type((std::tr1::nextafterf)(f, f), f);
verify_return_type((std::tr1::nextafterl)(ld, ld), ld);
- verify_return_type((std::tr1::nexttoward)(d, ld), d);
- verify_return_type((std::tr1::nexttoward)(f, ld), f);
+ verify_return_type((std::tr1::nexttoward)(d, d), d);
+ verify_return_type((std::tr1::nexttoward)(f, f), f);
verify_return_type((std::tr1::nexttoward)(ld, ld), ld);
+ verify_return_type((std::tr1::nexttoward)(f, ld), ld);
+ verify_return_type((std::tr1::nexttoward)(f, d), d);
verify_return_type((std::tr1::nexttowardf)(f, ld), f);
verify_return_type((std::tr1::nexttowardl)(ld, ld), ld);
#if 0
Modified: branches/release/libs/tr1/test/test_hash.cpp
==============================================================================
--- branches/release/libs/tr1/test/test_hash.cpp (original)
+++ branches/release/libs/tr1/test/test_hash.cpp 2011-03-07 11:43:45 EST (Mon, 07 Mar 2011)
@@ -31,7 +31,29 @@
verify_return_type(ch(t), std::size_t(0));
}
-class UDT;
+class UDT
+{
+ int m_value;
+public:
+ UDT(int v) : m_value(v) {}
+ int value()const { return m_value; }
+};
+
+namespace std{ namespace tr1{
+
+template<>
+struct hash<UDT> : public std::unary_function<UDT, std::size_t>
+{
+ typedef UDT argument_type;
+ typedef std::size_t result_type;
+ std::size_t operator()(const UDT& u)const
+ {
+ std::tr1::hash<int> h;
+ return h(u.value());
+ }
+};
+
+}}
int main()
{
@@ -55,6 +77,7 @@
check_hash(static_cast<const UDT*>(0));
check_hash(static_cast<volatile UDT*>(0));
check_hash(static_cast<const volatile UDT*>(0));
+ check_hash(UDT(1));
return 0;
}
Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk