Skip to content

Latest commit

 

History

History
34 lines (29 loc) · 415 Bytes

for_each.md

File metadata and controls

34 lines (29 loc) · 415 Bytes

Hello world

prog :

#include <iostream>
#include <toolsbox/for_each.hpp>
#include <tuple>

struct functor
{
  template <class T> void operator()(const T& value)
  {
    std::cout << value << std::endl; 
  }
};

int main()
{  
  toolsbox::for_each(functor(), 1, 2.5, "bla");
  toolsbox::for_each_by_tuple(functor(), std::make_tuple(1, 2.5, "bla"));

  return 0;
}

out:

1
2.5
bla
1
2.5
bla