This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // code that looks common enough for me to write and post it here | |
| // printing iterable of iterable/values of ... to ostream object | |
| // works on any std conatiner and on any class that meets | |
| // the requirements of Container(named requirement) | |
| // ====================================================================== | |
| // compile with g++ container_printer.cpp -o container_printer -std=c++17 | |
| // other compilers not guaranteed to compile this | |
| // ====================================================================== |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <functional> | |
| #include <iostream> | |
| using namespace std; | |
| template <typename... RetTs, typename... ArgTs> | |
| auto _for_each(std::function<RetTs(ArgTs...)>... funcs) | |
| { | |
| return [ = ] (ArgTs... args) { | |
| return tuple { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <vector> | |
| #include <tuple> | |
| #include <iostream> | |
| using namespace std; | |
| template < | |
| typename T1, | |
| typename T2, |
NewerOlder