what's the difference between

template<typename T>
auto add1(const T& a, const T& b)
{ return a + b; }


template<typename T>
auto add2(T a, const T& b)
{ return a += b; }




static_assert(not std::is_same_v<
decltype(add1( short{1}, short{2} )),
decltype(add2( short{1}, short{2} ))

Sign in to participate in the conversation
Qoto Mastodon

QOTO: Question Others to Teach Ourselves. A STEM-oriented instance.

An inclusive free speech instance.
All cultures and opinions welcome.
Explicit hate speech and harassment strictly forbidden.
We federate with all servers: we don't block any servers.