I wonder how we can add a function passing by reference to thread.. Integer examples are so easy at Internet i\'ve found, but couldn\'t find any example pass by reference ?<
Solution 1: use std::ref:
int number1 = 25; int number2 = 50; std::thread third(addp, std::ref(number1), std::ref(number2));
Solution 2: use a lambda:
int number1 = 25; int number2 = 50; std::thread third([&] { addp(number1, number2); });