Can't use 'template' keyword to specify the function is template when the function is operator() - by summerlight

Status : 

  Deferred<br /><br />
		The product team has reviewed this issue and has deferred it for consideration at a later time.<br /><br />
		A more detailed explanation for the resolution of this particular item may have been provided in the comments section.


1
0
Sign in
to vote
ID 794233 Comments
Status Closed Workarounds
Type Bug Repros 0
Opened 7/17/2013 5:42:22 AM
Access Restriction Public

Description

Can't use 'template' keyword to specify the function is template when the function is operator().

Below code should be compiled, but compiler complains of a line around (d) while it compiles (b) without any error. (Other major compilers like gcc/clang accept (d), but rejects (c))

The code should be compiled to increases portability of msvc based code, since the some other major compilers only accept (b) and (d).

struct s
{
    template<typename>
    void a() {}

    template<typename>
    void operator()() {}
};

template<typename T>
void t()
{
    T a;
    //a.a<int>(); // (a) should be compile error, but VC allows it now.
    a.template a<int>(); // (b) should be compiled, and VC allows it now.
    //a.operator()<int>(); // (c) should be compile error, but VC allows it now.
    a.template operator()<int>(); // (d) should be compiled, but VC doesn't allow it.
}

int main()
{
    t<s>();
}
Sign in to post a comment.
Posted by Microsoft on 7/26/2013 at 4:49 PM
Hi summerlight,

Thank you for taking the time to provide your feedback. After reviewing your reported issue, in the context of all the issues reported to us, we have decided not to take any action on this feedback at this time. We will re-consider our decision for a future release.

If this issue is severe, causing critical business situations or blocking your product development or deployment, please go to http://support.microsoft.com or call 1-800-MICROSOFT for assistance.
For Microsoft premier customers, please contact your administrator, your Technical Account Manager, or your Microsoft premier account representative.

Thanks,
Karl Niu
VC++ Team
Posted by Microsoft on 7/17/2013 at 11:26 PM
Thanks for your feedback.

We are rerouting this issue to the appropriate group within the Visual Studio Product Team for triage and resolution. These specialized experts will follow-up with your issue.
Posted by Microsoft on 7/17/2013 at 5:50 AM
Thank you for your feedback, we are currently reviewing the issue you have submitted. If this issue is urgent, please contact support directly(http://support.microsoft.com)