Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- static /*? void * ?*/ func(/*? void... ?*/) {
- /* Первый, второй аргумент? */
- return {false, "string"};
- }
- #include <iostream>
- #include <variant>
- #include <vector>
- using namespace std;
- using namespace string_literals;
- using Object = std::variant<bool, string, int, double>;
- using Objects = std::vector<Object>;
- Objects getT() {
- return {10, 3.4, "Hello"s, true};
- }
- int main() {
- auto Res = getT();
- for (auto i : Res) {
- std::visit([](auto item) { cout << item << endl; }, i);
- }
- }
Add Comment
Please, Sign In to add comment