C++ Logo

std-proposals

Advanced search

std::take(obj), aka std::exchange(obj, {})

From: Giuseppe D'Angelo <giuseppe.dangelo_at_[hidden]>
Date: Thu, 24 Sep 2020 23:53:40 +0200
Hello,

I'm attaching the first draft for a proposal for std::take, a function
that moves from an object, resets it to its default constructed state,
and returns the old value.

The idea has been floated already in the past on this mailing list here:

> https://groups.google.com/a/isocpp.org/forum/#!topic/std-proposals/qDB0BG-GQqQ/discussion


Any feedback is welcome.

Thank you,
-- 
Giuseppe D'Angelo | giuseppe.dangelo_at_[hidden] | Senior Software Engineer
KDAB (France) S.A.S., a KDAB Group company
Tel. France +33 (0)4 90 84 08 53, http://www.kdab.com
KDAB - The Qt, C++ and OpenGL Experts

Received on 2020-09-24 16:53:49