
On 2010-09-01 14:13, Roman Perepelitsa wrote:
2010/9/1 Roland Bock
mailto:rbock@eudoxos.de> Hi,
is there something in Boost.TypeTraits (or somewhere else) that allows me to check if a type is a boost::optional?
I'd like to do something like this:
template<typename T> typename enable_if
, T::value_type>::type foo(const T&); You can use is_instance_of from lambda library (see boost/lambda/detail/is_instance_of.hpp). It's not part of public interface though, so use it on your own risk.
template <class T> struct is_boost_optional : boost::lambda::is_instance_of_1
{} Roman Perepelitsa.
This seems to work, too:
// -------------------------------------------------------------
template