joboccara / NamedType

Implementation of strong types in C++
MIT License
772 stars 85 forks source link

tuple of NamedTypes #62

Open david8dixon opened 3 years ago

david8dixon commented 3 years ago

Any ideas on how one might provide a custom get function to avoid extra call to get on the named type in the following:

using Type1 = NamedType<int, TypeTag>;
using Type2 = NamedType<double, TypeTag>;
auto t = make_tuple(Type(1), Type(2.0));
auto e = get<1>(t).get();

I would prefer the following:

auto e = get<1>(t);

That way I can use the same functionality regardless of whether or not the tuple holds a named type.

DeveloperPaul123 commented 2 years ago

Would not adding the skill Callable solve this? See here.