by nwallin · 3y ago · 0 comments
This C++ code compiles and does what a casual reader would expect it to do:
#include <string>
#include <tuple>
using Foo = std::tuple<int, std::string, float>;
Foo foo(int a, const char* b, double c)
{
return {a,b,c};
}
godbolt: https://godbolt.org/z/Koa4zYT99I gotta be honest, this interface is exactly what I would like a tuple API to look like. I want to declare my tuple as a `tuple`, I want to give it a friendly name, and I want to explicitly declare the types in the tuple, and I want to all of that at compile time. This API is exactly the verbosity that I want; I would be unhappy with either more or less boilerplate than this.
> First-class support for these is important.
Agree to disagree.
Why are you assuming I don't use them? Sum types are great.