Guest User

Untitled

a guest
Feb 21st, 2018
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.50 KB | None | 0 0
  1. static /*? void * ?*/ func(/*? void... ?*/) {
  2. /* Первый, второй аргумент? */
  3. return {false, "string"};
  4. }
  5.  
  6. #include <iostream>
  7. #include <variant>
  8. #include <vector>
  9. using namespace std;
  10. using namespace string_literals;
  11. using Object = std::variant<bool, string, int, double>;
  12. using Objects = std::vector<Object>;
  13. Objects getT() {
  14. return {10, 3.4, "Hello"s, true};
  15. }
  16. int main() {
  17. auto Res = getT();
  18. for (auto i : Res) {
  19. std::visit([](auto item) { cout << item << endl; }, i);
  20. }
  21. }
Add Comment
Please, Sign In to add comment