diff --git a/include/boost/algorithm/string/classification.hpp b/include/boost/algorithm/string/classification.hpp index 9811fb0..e2d7c39 100644 --- a/include/boost/algorithm/string/classification.hpp +++ b/include/boost/algorithm/string/classification.hpp @@ -235,9 +235,12 @@ namespace boost { const predicate_facade& Pred1, const predicate_facade& Pred2 ) { + // Doing the static_cast with the pointer instead of the reference + // is a workaround for some compilers which have problems with + // static_cast's of template references, i.e. CW8. /grafik/ return detail::pred_andF( - static_cast(Pred1), - static_cast(Pred2) ); + *static_cast(&Pred1), + *static_cast(&Pred2) ); } //! predicate 'or' composition predicate @@ -256,9 +259,12 @@ namespace boost { const predicate_facade& Pred1, const predicate_facade& Pred2 ) { + // Doing the static_cast with the pointer instead of the reference + // is a workaround for some compilers which have problems with + // static_cast's of template references, i.e. CW8. /grafik/ return detail::pred_orF( - static_cast(Pred1), - static_cast(Pred2)); + *static_cast(&Pred1), + *static_cast(&Pred2)); } //! predicate negation operator @@ -273,7 +279,10 @@ namespace boost { inline detail::pred_notF operator!( const predicate_facade& Pred ) { - return detail::pred_notF(static_cast(Pred)); + // Doing the static_cast with the pointer instead of the reference + // is a workaround for some compilers which have problems with + // static_cast's of template references, i.e. CW8. /grafik/ + return detail::pred_notF(*static_cast(&Pred)); } } // namespace algorithm