Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r78447 - sandbox/type_erasure/libs/type_erasure/example
From: steven_at_[hidden]
Date: 2012-05-12 22:12:15


Author: steven_watanabe
Date: 2012-05-12 22:12:14 EDT (Sat, 12 May 2012)
New Revision: 78447
URL: http://svn.boost.org/trac/boost/changeset/78447

Log:
Fix bug in example.
Text files modified:
   sandbox/type_erasure/libs/type_erasure/example/associated.cpp | 8 ++++++--
   1 files changed, 6 insertions(+), 2 deletions(-)

Modified: sandbox/type_erasure/libs/type_erasure/example/associated.cpp
==============================================================================
--- sandbox/type_erasure/libs/type_erasure/example/associated.cpp (original)
+++ sandbox/type_erasure/libs/type_erasure/example/associated.cpp 2012-05-12 22:12:14 EDT (Sat, 12 May 2012)
@@ -31,7 +31,11 @@
 
     For example, we can define a concept for
     holding any iterator, raw pointer, or
- smart pointer as follows:
+ smart pointer as follows.
+
+ Note the extra trickery to make sure that it is safe
+ to instantiate pointee with a placeholder, because
+ argument dependant lookup can cause spurious instantiations.
 */
 
 template<class T>
@@ -68,7 +72,7 @@
             typeid_<pointer<>::element_type>
>
> x(&i);
- int j = boost::type_erasure::any_cast<int>(*x); // j == i
+ int j = any_cast<int>(*x); // j == i
     //]
 }
 


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