vittorioromeo / scelta

(experimental) Syntactic sugar for variant and optional types.
https://vittorioromeo.info
MIT License
157 stars 11 forks source link

Resolve recursive type by index #2

Open vittorioromeo opened 7 years ago

vittorioromeo commented 7 years ago
namespace sr = scelta::recursive;

using _ = sr::placeholder;
using builder = sr::builder<std::variant<int, std::vector<_>>>;
using type = sr::type<builder>;

Currently, to resolve the vector, the user has to say:

using vector_type = sr::resolve<builder, std::vector<_>>;

It would probably be nicer to say:

using vector_type = sr::resolve_nth<builder, 1>;