Visitors for std::variant

This lesson explains std::visit, it''s declaration and use.

We'll cover the following

With the introduction of std::variant, we also got a handy STL function called std::visit. It can call a given “visitor” on all passed variants.

Visitor Declaration

Get hands-on with 1400+ tech skills courses.