The istream operator>>
's require a reference to an existing object. That means what they do is assignment rather than in-place construction, right?
Well, how can I skip the initial construction? Maybe the compiler can optimize it away, but I may still be required to provide parameters I would rather not need to. Can this be done with istreams at all?
... I would like to be able to have, say,
template <typename T> void emplace_from(std::istream stream, T* place);
work for all types for T for which stream >> my_t_variable
works. Although, admittedly, this function declaration looks a bit ugly.