std::any::swap
From cppreference.com
void swap( any& other ) noexcept; |
(since C++17) | |
Swaps the content of two any
objects.
[edit] Parameters
other | - | object to swap with |
[edit] Example
Run this code
#include <any> #include <print> #include <string> #include <string_view> int main() { std::any a = std::string{"King"};