0

In the header file "std_function.h" there is this template class, I know what it does but I got curious about <_Res(_ArgsTypes...)>. I've never seen anywhere something like that

template<typename _Signature>
class function

template<typename _Res, typename... _ArgTypes>
    class function<_Res(_ArgTypes...)>
    : public _Maybe_unary_or_binary_function<_Res, _ArgTypes...>,
      private _Function_base {
           //...body of class
};

Can anyone explain this to me?

cigien
  • 57,834
  • 11
  • 73
  • 112

1 Answers1

0

_Res(_ArgTypes...) is the type of a function taking _ArgTypes... as parameters and returning something of type _Res

Marshall Clow
  • 15,972
  • 2
  • 29
  • 45
  • Ok I understood that, but this was just an example, what do I do putting argument after the class name –  Jan 21 '21 at 16:51
  • I'm not sure what you're asking. – Marshall Clow Jan 21 '21 at 16:59
  • an usual template class is declared like the following example `template class myClass;`, instead for function there are some argument that follow the class name like the following example `template class myClass;`, I hope to have made myself clear –  Jan 21 '21 at 17:02