webpp icon indicating copy to clipboard operation
webpp copied to clipboard

ituple

Open the-moisrex opened this issue 3 years ago • 6 comments

A tuple that has all the features of std::tuple + these:

  • you can get a new tuple by calling .structured<N>()
    • this new tuple will be a resized version of the original
    • this is done to make structured binding of unknown lengths of tuples possible.
  • nothing_type will be returned if the index is higher

todo

  • [x] rename
  • [x] chose a place to put it
  • [x] copy implementation
  • [x] implement todo comments in the code
  • [x] copy simple tests from codeshells
  • [x] test the newly implemented parts
  • [ ] figure out how this tuple can be used inside a structured bindings in a for loop. It's for sql_statement (there's a test for it in sql_test.cpp)
  • [x] fix tests
  • [ ] Make ituple iterator work with tuples as well
  • [ ] Make ituple iterator work with custom types that support "structured bindings"
  • [ ] tuplifying the sql stmt binder (or column)
  • [ ] renaming sql stmt binder to something better or separating the idea of binder and column
  • [x] sql statement iterator
  • [ ] ituple_iterator that supports sql stmt iter
  • [ ] ituple which supports default type and default value generator
  • [x] use ituple options in ituple_iterable
  • [x] use ituple options in ituple_iterator
  • [ ] fix type traits tests

the-moisrex avatar Jun 25 '22 00:06 the-moisrex

other names

  • resizable_tuple
  • istl::tuple
  • mituple
  • mi_tuple
  • expandable_tuple
  • ituple for improved tuple

the-moisrex avatar Jun 25 '22 00:06 the-moisrex

I've already implement most of it here: https://github.com/the-moisrex/codeshells/blob/main/cpp.tuple.structured.binding/main.cpp

the-moisrex avatar Jun 25 '22 00:06 the-moisrex

It's done now. I just have to figure out how to decompose this in a for loop.

the-moisrex avatar Jun 26 '22 22:06 the-moisrex

Do I have to reimplement all of the ituple_iterator just like I did with rapidjson? Come on!

the-moisrex avatar Jun 28 '22 23:06 the-moisrex

Somewhere along the way I forgot how sql statement was made and now I can't use ituple for it without changing what ituple is now.

the-moisrex avatar Jun 30 '22 11:06 the-moisrex

Lazy Iterators

Seems like a good idea to be used here.

the-moisrex avatar Jun 30 '22 15:06 the-moisrex