grandstack

u/grandstack



r/cpp•

Got an idea for a different and more ergonomic variation of the apply function where you query the types with the lamda parameters, don't know if this has been done before. Would like to know what you think and if there's anything I can improve upon.

Where the tuples has a multiple of the same type the apply function gets the first occurence, if theres another lambda paramter with the same type it gets the second occurence in the tuple.

auto x = std::make_tuple(1, 2, 3, 4, 5, 6, 7, 8.0, 9, 10, 11, 33, 13, 14, 15.f, 16, 17, 18, 2);

std::cout << adv::apply(x, [](float a, double b, int c, int d) {

	std::cout << a << std::endl;
	std::cout <&l
126


You've reached the end of this feed.