Forums before death by AOL, social media and spammers... "We can't have nice things"
|    comp.lang.c++.moderated    |    Moderated discussion of C++ superhackery    |    33,346 messages    |
[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]
|    Message 32,528 of 33,346    |
|    Casey Carter to Ivan Godard    |
|    Re: How to default an undefined operatio    |
|    05 Sep 12 14:53:58    |
      From: casey_at_carter_dot_net@nospam.invalid              On 2012-09-05 02:48, Ivan Godard wrote:              > I have a template class taking a typename T argument, and need to       > define a differenceType representing the abstract "distance" between       > any pair of values. The template is instantiated with enums,       > built-in types, and random user classes that define       > operator-(T, T). This difference type was initially declared as:       > typedef typeof(T() - T()) differenceType;       >       > I recently converted an existing enum to a C++11 "enum class", and       > the above broke because operator- was not defined for enum classes       > and there is no conversion to something that defines it.              This is exactly the use case for std::declval |
[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]
(c) 1994, bbs@darkrealms.ca