What trait / concept can guarantee memsetting an object is well defined? : <p>Let's say I have defined a <code>zero_initialize()</code> function:</p>

<pre><code>template&lt;class T&gt;
T zero_initialize()
{
    T result;
    std::memset(&amp;result, 0, sizeof(result));
    return result;
}

// usage: auto data = zero_initialize&lt;Data&gt;();
</code></pre>

<p>Calling <code>zero_initialize()</code> for some types would lead to undefined behavior<sup>1, </sup><sup>2</sup>. I'm currently enforcing <code>T</code> to verify <a href="https://en.cppreference.com/w/cpp/types/is_pod" rel="noreferrer"><code>std::is_pod</code></a>. With that trait being deprecated in C++20 and the coming of concepts, I'm curious how <code>zero_initialize()</code> should evolve.</p>

<ol>
<li>What (minimal) trait / concept can guarantee memsetting an object is well defined?</li>
<li>Should I use <a href="https://en.cppreference.com/w/cpp/memory/uninitialized_fill" rel="noreferrer"><code>std::uninitialized_fill</code></a> instead of <code>std::memset</code>? And why?</li>
<li>Is this function made obsolete by one of C++ initialization syntaxes for a subset of types? Or will it be with the upcoming of future C++ versions?</li>
</ol>

<hr>

<p><sup>1)</sup> <a href="https://stackoverflow.com/a/499078/5470596">Erase all members of a class</a>.<br>
<sup>2)</sup> <a href="https://stackoverflow.com/a/30980240/5470596">What would be reason for “undefined behaviors” upon using memset on library class(std::string)? [closed]</a></p>
