Advertisement
onilink_

Untitled

May 27th, 2020
805
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.48 KB | None | 0 0
  1. void func(double, double) { std::cout << "func" << std::endl; }
  2.  
  3. template<std::size_t I = 0, typename... Tp>
  4. inline typename std::enable_if<I == sizeof...(Tp), void>::type
  5.     for_each(pack<Tp...> &)
  6. {
  7. }
  8.  
  9. template<std::size_t I = 0, typename... Tp>
  10. inline typename std::enable_if<I < sizeof...(Tp), void>::type
  11.     for_each(pack<Tp...>& t)
  12. {
  13.     std::cout << I << ',';
  14.     for_each<I + 1, Tp...>(t);
  15. }
  16.  
  17. int main() {
  18.     parameters<decltype(func)> pack;
  19.     for_each(pack);
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement