
1 Sep
2010
1 Sep
'10
12:13 p.m.
2010/9/1 Roland Bock
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