Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r78697 - in branches/release: . boost boost/functional boost/functional/detail libs libs/detail libs/detail/test/container_fwd libs/functional libs/functional/hash/doc libs/functional/hash/examples libs/functional/hash/test
From: dnljms_at_[hidden]
Date: 2012-05-27 17:13:50


Author: danieljames
Date: 2012-05-27 17:13:49 EDT (Sun, 27 May 2012)
New Revision: 78697
URL: http://svn.boost.org/trac/boost/changeset/78697

Log:
Hash: Merge deprecated header warning + some documentation.

Added:
   branches/release/libs/functional/hash/examples/template.cpp
      - copied unchanged from r78366, /trunk/libs/functional/hash/examples/template.cpp
   branches/release/libs/functional/hash/examples/template.hpp
      - copied unchanged from r78366, /trunk/libs/functional/hash/examples/template.hpp
   branches/release/libs/functional/hash/test/deprecated_container_fwd.cpp
      - copied unchanged from r78533, /trunk/libs/functional/hash/test/deprecated_container_fwd.cpp
Properties modified:
   branches/release/ (props changed)
   branches/release/boost/ (props changed)
   branches/release/boost/functional/ (props changed)
   branches/release/libs/ (props changed)
   branches/release/libs/detail/ (props changed)
   branches/release/libs/functional/ (props changed)
Text files modified:
   branches/release/boost/functional/detail/container_fwd.hpp | 14 +++++++++++---
   branches/release/libs/detail/test/container_fwd/container_fwd_test.cpp | 2 +-
   branches/release/libs/functional/hash/doc/changes.qbk | 2 ++
   branches/release/libs/functional/hash/doc/ref.xml | 17 ++++++++++++++---
   branches/release/libs/functional/hash/doc/tutorial.qbk | 12 +++++++++++-
   branches/release/libs/functional/hash/examples/Jamfile.v2 | 1 +
   branches/release/libs/functional/hash/test/Jamfile.v2 | 1 +
   7 files changed, 41 insertions(+), 8 deletions(-)

Modified: branches/release/boost/functional/detail/container_fwd.hpp
==============================================================================
--- branches/release/boost/functional/detail/container_fwd.hpp (original)
+++ branches/release/boost/functional/detail/container_fwd.hpp 2012-05-27 17:13:49 EDT (Sun, 27 May 2012)
@@ -1,11 +1,11 @@
 
-// Copyright 2005-2008 Daniel James.
+// Copyright 2005-2012 Daniel James.
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
 
 // Forwarding header for container_fwd.hpp's new location.
-// This header is deprecated, I'll be adding a warning in a future release,
-// then converting it to an error and finally removing this header completely.
+// This header is deprecated, I'll change the warning to an error in a future
+// release, and then later remove the header completely.
 
 #if !defined(BOOST_FUNCTIONAL_DETAIL_CONTAINER_FWD_HPP)
 #define BOOST_FUNCTIONAL_DETAIL_CONTAINER_FWD_HPP
@@ -14,6 +14,14 @@
 # pragma once
 #endif
 
+#if defined(__EDG__)
+#elif defined(_MSC_VER) || defined(__BORLANDC__) || defined(__DMC__)
+#pragma message("Warning: boost/functional/detail/container_fwd.hpp is deprecated, use boost/detail/container_fwd.hpp instead.")
+#elif defined(__GNUC__) || defined(__HP_aCC) || \
+ defined(__SUNPRO_CC) || defined(__IBMCPP__)
+#warning "boost/functional/detail/container_fwd.hpp is deprecated, use boost/detail/container_fwd.hpp instead."
+#endif
+
 #include <boost/detail/container_fwd.hpp>
 
 #endif

Modified: branches/release/libs/detail/test/container_fwd/container_fwd_test.cpp
==============================================================================
--- branches/release/libs/detail/test/container_fwd/container_fwd_test.cpp (original)
+++ branches/release/libs/detail/test/container_fwd/container_fwd_test.cpp 2012-05-27 17:13:49 EDT (Sun, 27 May 2012)
@@ -3,7 +3,7 @@
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
 
-#include <boost/functional/detail/container_fwd.hpp>
+#include <boost/detail/container_fwd.hpp>
 
 #if BOOST_WORKAROUND(__GNUC__, < 3) && \
     !defined(__SGI_STL_PORT) && !defined(_STLPORT_VERSION)

Modified: branches/release/libs/functional/hash/doc/changes.qbk
==============================================================================
--- branches/release/libs/functional/hash/doc/changes.qbk (original)
+++ branches/release/libs/functional/hash/doc/changes.qbk 2012-05-27 17:13:49 EDT (Sun, 27 May 2012)
@@ -129,5 +129,7 @@
   Avoid gcc's `-Wfloat-equal` warning.
 * [@http://svn.boost.org/trac/boost/ticket/6806 Ticket 6806]:
   Support `std::array` and `std::tuple` when available.
+* Add deprecation warning to the long deprecated
+ `boost/functional/detail/container_fwd.hpp`.
 
 [endsect]

Modified: branches/release/libs/functional/hash/doc/ref.xml
==============================================================================
--- branches/release/libs/functional/hash/doc/ref.xml (original)
+++ branches/release/libs/functional/hash/doc/ref.xml 2012-05-27 17:13:49 EDT (Sun, 27 May 2012)
@@ -55,6 +55,10 @@
               is defined. The specializations are still defined, so only the specializations
               required by TR1 are defined.
             </para>
+ <para>
+ Forward declared in
+ <code>&lt;boost/functional/hash_fwd.hpp&gt;</code>
+ </para>
           </notes>
           <throws><para>
             Only throws if
@@ -451,6 +455,10 @@
           <para><functionname>hash_value</functionname> is called without
           qualification, so that overloads can be found via ADL.</para>
           <para>This is an extension to TR1</para>
+ <para>
+ Forward declared in
+ <code>&lt;boost/functional/hash_fwd.hpp&gt;</code>
+ </para>
         </notes>
         <throws>
           Only throws if <functionname>hash_value</functionname>(T) throws.
@@ -499,15 +507,14 @@
 
 return seed;
 </programlisting>
- </para>For the three arguments overload:
+ </para>
+ <para>For the three arguments overload:</para>
 <programlisting>
 for(; first != last; ++first)
 {
     <functionname>hash_combine</functionname>(seed, *first);
 }
 </programlisting>
- <para>
- </para>
         </effects>
         <notes>
           <para>
@@ -516,6 +523,10 @@
             container.
           </para>
           <para>This is an extension to TR1</para>
+ <para>
+ Forward declared in
+ <code>&lt;boost/functional/hash_fwd.hpp&gt;</code>
+ </para>
         </notes>
         <throws><para>
           Only throws if <code><functionname>hash_value</functionname>(std::iterator_traits&lt;It&gt;::value_type)</code>

Modified: branches/release/libs/functional/hash/doc/tutorial.qbk
==============================================================================
--- branches/release/libs/functional/hash/doc/tutorial.qbk (original)
+++ branches/release/libs/functional/hash/doc/tutorial.qbk 2012-05-27 17:13:49 EDT (Sun, 27 May 2012)
@@ -198,5 +198,15 @@
     std::vector<std::string> some_strings;
     std::size_t hash = ``[funcref boost::hash_range]``(some_strings.begin(), some_strings.end());
 
-[endsect]
+Note that when writing template classes, you might not want to include the main
+hash header as it's quite an expensive include that brings in a lot of other
+headers, so instead you can include the `<boost/functional/hash_fwd.hpp>`
+header which forward declares [classref boost::hash],
+[funcref boost::hash_range] and [funcref boost::hash_combine]. You'll need to
+include the main header before instantiating [classref boost::hash]. When using
+a container that uses [classref boost::hash] it should do that for you, so your
+type will work fine with the boost hash containers. There's an example of this
+in [@boost:/libs/unordered/examples/template.hpp template.hpp] and
+[@boost:/libs/unordered/examples/template.cpp template.cpp].
 
+[endsect]

Modified: branches/release/libs/functional/hash/examples/Jamfile.v2
==============================================================================
--- branches/release/libs/functional/hash/examples/Jamfile.v2 (original)
+++ branches/release/libs/functional/hash/examples/Jamfile.v2 2012-05-27 17:13:49 EDT (Sun, 27 May 2012)
@@ -6,3 +6,4 @@
 run books.cpp ;
 run point.cpp ;
 run portable.cpp ;
+run template.cpp ;

Modified: branches/release/libs/functional/hash/test/Jamfile.v2
==============================================================================
--- branches/release/libs/functional/hash/test/Jamfile.v2 (original)
+++ branches/release/libs/functional/hash/test/Jamfile.v2 2012-05-27 17:13:49 EDT (Sun, 27 May 2012)
@@ -50,6 +50,7 @@
         [ compile-fail implicit_fail_test.cpp : <define>BOOST_HASH_NO_IMPLICIT_CASTS ]
         [ run hash_no_ext_macro_1.cpp : : : <define>BOOST_HASH_NO_IMPLICIT_CASTS ]
         [ run hash_no_ext_macro_2.cpp : : : <define>BOOST_HASH_NO_IMPLICIT_CASTS ]
+ [ compile deprecated_container_fwd.cpp ]
     ;
 
 test-suite functional/hash_implicit_casts


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