I have to work with some heavily templated code which I am trying to decipher.
I see two different constructs and I am not sure if I am missing something. Here is a simplified example of these type conversions which are used at some places, is there a difference between the following statements?
template<typename T, typename S> S my_function(T t)
{
// version 1:
S s = t
return s;
// version 2:
return S(t);
}
I am thinking to changing everything to one style, are the two statements 100% equivalent and if not, what are the differences?
` with `T` deduced instead of having to write `function`. – nwp Jan 31 '18 at 11:27