mirror of
https://github.com/boostorg/algorithm.git
synced 2025-07-12 12:06:35 +02:00
Work-around for CW8 problems with static_cast of references to templates.
[SVN r24178]
This commit is contained in:
@ -235,9 +235,12 @@ namespace boost {
|
|||||||
const predicate_facade<Pred1T>& Pred1,
|
const predicate_facade<Pred1T>& Pred1,
|
||||||
const predicate_facade<Pred2T>& Pred2 )
|
const predicate_facade<Pred2T>& 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<Pred1T,Pred2T>(
|
return detail::pred_andF<Pred1T,Pred2T>(
|
||||||
static_cast<const Pred1T&>(Pred1),
|
*static_cast<const Pred1T*>(&Pred1),
|
||||||
static_cast<const Pred2T&>(Pred2) );
|
*static_cast<const Pred2T*>(&Pred2) );
|
||||||
}
|
}
|
||||||
|
|
||||||
//! predicate 'or' composition predicate
|
//! predicate 'or' composition predicate
|
||||||
@ -256,9 +259,12 @@ namespace boost {
|
|||||||
const predicate_facade<Pred1T>& Pred1,
|
const predicate_facade<Pred1T>& Pred1,
|
||||||
const predicate_facade<Pred2T>& Pred2 )
|
const predicate_facade<Pred2T>& 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<Pred1T,Pred2T>(
|
return detail::pred_orF<Pred1T,Pred2T>(
|
||||||
static_cast<const Pred1T&>(Pred1),
|
*static_cast<const Pred1T*>(&Pred1),
|
||||||
static_cast<const Pred2T&>(Pred2));
|
*static_cast<const Pred2T*>(&Pred2));
|
||||||
}
|
}
|
||||||
|
|
||||||
//! predicate negation operator
|
//! predicate negation operator
|
||||||
@ -273,7 +279,10 @@ namespace boost {
|
|||||||
inline detail::pred_notF<PredT>
|
inline detail::pred_notF<PredT>
|
||||||
operator!( const predicate_facade<PredT>& Pred )
|
operator!( const predicate_facade<PredT>& Pred )
|
||||||
{
|
{
|
||||||
return detail::pred_notF<PredT>(static_cast<const PredT&>(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<PredT>(*static_cast<const PredT*>(&Pred));
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace algorithm
|
} // namespace algorithm
|
||||||
|
Reference in New Issue
Block a user