Boost logo

Boost :

Subject: [boost] Conversion operator for boost any
From: Leonid Frenkel (subkin13_at_[hidden])
Date: 2010-12-01 02:58:54


Hello,

I found adding the following conversion operator to Boost.Any was very
helpful in some cases: (specially when using macros inside functions)

template <typename ValueType>
operator ValueType()
{
return any_cast<ValueType>(*this);
}


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