4 ms·
I've found tuples to be very useful as a temporary structure. I find a tuple is to a structure what a lambda is to a function. The most useful time I've used a
by green7ea 11y ago
I've found tuples to be very useful as a temporary structure. I find a tuple is to a structure what a lambda is to a function.
The most useful time I've used a tuple was to build OpenGL vertex buffer objects in a more dynamic manner. You can find the code here (https://github.com/green7ea/OpenGL-Triangle/blob/master/src/triangle.cpp https://github.com/green7ea/OpenGL-Triangle/blob/master/src/...) from line 62 to 70. The big win is that most if not all of the work is done at compile time and there is no space overhead to any of it.
Using boost fusion here would have been overkill as it would have added a lot of extra dependencies. I get that it's more powerful but for a lot of low level work, the extra power isn't necessary and a boost dependency isn't required.