C++ std::variant vs std::any : <p>C++17 presents <a href="https://en.cppreference.com/w/cpp/utility/variant" rel="noreferrer"><code>std::variant</code></a> and <a href="https://en.cppreference.com/w/cpp/utility/any" rel="noreferrer"><code>std::any</code></a>, both able to store different type of values under an object. For me, they are somehow similar (are they?).</p>

<p>Also <code>std::variant</code> restricts the entry types, beside this one. Why we should prefer <code>std::variant</code> over <code>std::any</code> which is simpler to use?</p>
