wt., 2 kwi 2019 o 16:44 Peter Dimov via Boost
Andrey Semashev wrote:
Also, IMHO, it's better to have libraries more focused and fine grained. Why not have `expected` as a separate library?
expected
is basically a variant, with a slightly different interface. It might be implemented like/with variant, but conceptually this is a different component. Just like `optional` is a different component than `variant`. All these components have different use cases and communicate different intentions.
It is a different component. That wasn't the question though. The question was, why not have it as a separate library. And the answer is, because the two components share too much of an implementation, and because the design decisions made about one component affect the other (and vice versa - the converting constructor and the subset() member function of `variant` are needed by `expected`).
This sounds a bit like variant2 is just a byproduct from the implementation of `expected`. Regards, &rzej;