Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C++ > Near identical overloads with SFINAE in C++0X

Reply
Thread Tools

Near identical overloads with SFINAE in C++0X

 
 
Marc
Guest
Posts: n/a
 
      04-21-2011
Richard Smith wrote:

> On Apr 20, 7:11*pm, Noah Roberts <(E-Mail Removed)> wrote:
>> I disagree and I would say that different semantics should mean
>> different functions entirely. *Neither enable_if nor dispatching is
>> appropriate in that case.

>
> That's not always possible. What if it's a constructor, for example?


Thanks, that's precisely my case. The code in the original post had
functions because there is some delegation going on, but the goal is a
constructor. (and amusingly enough, the class has "vector" as part of
its name

Each of the 2 constructors makes sense individually, and if there was
only one of them, I'd use enable_if on it to restrict possible
ambiguities. It is only when I wrote both that I noticed it was
forbidden for technical reasons.
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
error C2665: 'delete' : none of the 2 overloads can convert parameter 1 from type 'const class xyz*' Angus C++ 2 01-07-2007 04:09 PM
error C2666 overloads have similar conversions wongjoekmeu@yahoo.com C++ 5 02-04-2005 07:23 PM
Python's idiom for function overloads Frans Englich Python 12 02-02-2005 10:56 PM
Has apparent 2.4b1 bug been fixed? flatten in Lib\compiler\ast.py overloads 'list' name Bengt Richter Python 3 01-19-2005 05:17 PM
Overloads modifier Fabio Negri Cicotti [MCP] ASP .Net 3 12-13-2004 05:20 PM



Advertisments