Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

g++ std::is_function implementation: what does _ArgTypes followed by 6 periods mean?

I was looking at my headers (g++-4.5.2) for the implementations of some templates in , and I found the following:

/// is_function
template<typename>
  struct is_function
  : public false_type { };
template<typename _Res, typename... _ArgTypes>
  struct is_function<_Res(_ArgTypes...)>
  : public true_type { };
template<typename _Res, typename... _ArgTypes>
  struct is_function<_Res(_ArgTypes......)>
  : public true_type { };

The first two declarations seem reasonable, but I can't figure out how the third works. What is ......? I looked for it in the standard, and couldn't find anything.

like image 981
Brian Bi Avatar asked Feb 02 '13 08:02

Brian Bi


1 Answers

It's the same as:

_Res(_ArgTypes..., ...)

The comma before an ellipses parameter is optional.

like image 119
GManNickG Avatar answered Oct 25 '22 01:10

GManNickG