SHARE
TWEET

Untitled

a guest Jun 16th, 2017 9 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.     namespace detail
  2.     {
  3.         template<typename F, typename A>
  4.         void for_each(const F& f, A&& value)
  5.         {
  6.             f(std::forward<A>(value));
  7.         }
  8.  
  9.         template<typename F, typename A, typename... Args>
  10.         void for_each(const F& f, A&& value, Args&&... args)
  11.         {
  12.             for_each(f, std::forward<A>(value));
  13.             for_each(f, std::forward<Args>(args)...);
  14.         }
  15.     }
  16.  
  17.     template<typename F, typename... Args>
  18.     void for_each(const F& f, Args&&... args)
  19.     {
  20.         detail::for_each(f, std::forward<Args>(args)...);
  21.     }
RAW Paste Data
Top