fork(2) download
  1. #include <list>
  2. #include <tuple>
  3.  
  4. struct RawTable { };
  5.  
  6. struct Table
  7. {
  8. template<class Type>
  9. struct Meta
  10. {
  11. Meta(const char * columnName) : columnName(columnName) { }
  12.  
  13. using type = Type;
  14. const char * const columnName;
  15. // . . .
  16. };
  17.  
  18. template<class... MetaArgs>
  19. static inline
  20. auto parse(RawTable&&, MetaArgs&&...) -> std::list<std::tuple<typename MetaArgs::type...>>
  21. {
  22. return std::list<std::tuple<typename MetaArgs::type...>>();
  23. }
  24. };
  25.  
  26. int main()
  27. {
  28. for (std::tuple<bool,int> & tuple : Table::parse(RawTable(),
  29. Table::Meta<bool>("field1"),
  30. Table::Meta<int>("field2")))
  31. {
  32. (void)tuple;
  33. //TODO
  34. }
  35.  
  36. return 0;
  37. }
  38.  
Success #stdin #stdout 0s 3408KB
stdin
Standard input is empty
stdout
Standard output is empty