0

As far as I can tell decltype takes one argument: http://en.cppreference.com/w/cpp/language/decltype

However, TartanLlama has answered two of my questions using a decltype call which took two parameters:

  1. https://stackoverflow.com/a/30190317/2642059
  2. https://stackoverflow.com/a/30302586/2642059

I see that code compile and run as TartanLlama states it will, but I don't understand how a two argument decltype call should behave.

Can someone provide me a reference for what two argument decltype should do?

Community
  • 1
  • 1
Jonathan Mee
  • 37,899
  • 23
  • 129
  • 288
  • @MikeSeymour That is indeed an exact duplicate. I'm not sure if I understand the application of the comma operator fully though. In a Substitution Failure Is Not An Error context it makes sense, but [AndyProwl](http://stackoverflow.com/users/1932150/andy-prowl) gives an example of the comma operator in a `static_assert` what happens if the left hand side fails? Does it just always return the right hand side irrespectively? – Jonathan Mee May 18 '15 at 18:15
  • 1
    If it's not in a SFINAE context, you'd simply get an error. – Mike Seymour May 18 '15 at 18:18

0 Answers0