c++ - C++11 Avoiding Redundant Return Type in specific Situation -


ok, has looked @ this. i've recreated exact scenario easy viewing @ link below, i'll comment out original text had wasn't clear. http://cpp.sh/5lp4l

in comment section show calling make_some(32, std::string{"hi"}) without specifying data type declaration call. realize seems insane , way above expected use case, automatically inferring composite type (inferring wanted data, based on int/string) based on arguments wasn't necessary, or idea.

the compiler right. there's no relation given between t , args. hence, cannot determine queryresult<t> means.

what apparently expect return type of somefn forces t int, int. that's not possible 2 reasons: t denotes single type, , there's no mechanism return statement somehow affects template instantiation of make_some.


Comments

Popular posts from this blog

android - Why am I getting the message 'Youractivity.java is not an activity subclass or alias' -

Making Empty C++ Project: General exception (Exception from HRESULT:0x80131500) Visual Studio Community 2015 -

How to fix java warning for "The value of the local variable is not used " -