Copyright Matus Chochlik. Distributed under the Boost Software License, Version 1.0. See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt
#include <iostream>
auto main() -> int {
using std::cout;
using std::endl;
auto func = overloaded(
[](int x) { cout << "int: " << x << endl; },
[](float x) { cout << "float: " << x << endl; },
[](double x) { cout << "double: " << x << endl; },
[](
string_view x) { cout <<
"string: " << x << endl; },
[](auto x) { cout << "other: " << x << endl; });
func(v("zero"));
func(123);
func(45.F);
func(67.8);
func('9');
return 0;
}
basic_string_span< const char > string_view
Alias for const string views.
Definition: string_span.hpp:116