Boost logo

Boost :

From: Sérgio Vale e Pace (svpace.forum_at_[hidden])
Date: 2005-01-27 07:52:29


why not :

template <typename T>
void reset(T& t)
{
    t = T();
}

but I don´t think this exists in boost already, but should.

On Wed, 26 Jan 2005 16:48:41 +0100, Stefan Slapeta <stefan_at_[hidden]> wrote:
> Hi all,
>
> do we have a non-member reset() somewhere? Something like
>
> template <typename T>
> void reset(T& t)
> {
> std::swap(t, T());
> }
>
> (of course to be refined...)
>
> Stefan
>
> _______________________________________________
> Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
>


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