
27 May
2008
27 May
'08
1:13 p.m.
Hansi
At the moment I mix references and pointers. I know that it would be better to not use pointers. But there are cases where it is easier to use it. In this cases it is allways != NULL There are made a few more checks with the validator (ranges, possible values e.g.).
This is probably more scalable (you may need disable_if, though): template<class T> T& unwrap(T&); template<class T> T& unwrap(T*); char const* unwrap(char const*); template<class T> T& unwrap(reference_wrapper<T>); template<class T> T& unwrap(optional<T>); -- Alexander