32

The following are some partial specializations for std::is_function from libstdc++'s <type_traits>:

  /// 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 { };

  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 { };

  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 { };

What exactly do the last three partial specializations mean, and how are they different from the first three? I tried searching for ...... in C++14 specification, but failed to find anything helpful.

chys
  • 1,546
  • 13
  • 17
  • A narrower version of this question would focus on why `is_function` requires these specializations(*which I cover*) and how do they work. This would differentiate it from the proposed duplicate which focuses solely on is this valid syntax. – Shafik Yaghmour Nov 03 '15 at 21:44

0 Answers0