Boost logo

Boost :

Subject: [boost] [PATCH v2] [exception] Replace C cast with static_cast for Metrowerks C++
From: Joshua Juran (jjuran_at_[hidden])
Date: 2011-03-05 05:57:53


Metrowerks C++ 2.4.1 thinks the type of (T*)0 is T, rather than T*.
But static_cast works fine.

---
This patch doesn't affect the compilation of g++ 4.0.1.
diff --git boost/exception/exception.hpp boost/exception/exception.hpp
index adaac68..afb2008 100644
--- boost/exception/exception.hpp
+++ boost/exception/exception.hpp
@@ -334,7 +334,7 @@ boost
          struct
          enable_error_info_return_type
              {
-            typedef typename  
enable_error_info_helper 
<T,sizeof(exception_detail::dispatch_boost_exception((T*)0))>::type  
type;
+            typedef typename  
enable_error_info_helper 
< 
T 
,sizeof 
(exception_detail 
::dispatch_boost_exception(static_cast<T*>(0)))>::type type;
              };
          }




Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk