Boost logo

Boost Users :

From: Alexander Nasonov (alnsn_at_[hidden])
Date: 2008-05-27 09:13:16


Hansi <hansipet <at> web.de> writes:
> 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

Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net