Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: threads function  (Read 1765 times)

0 Members and 1 Guest are viewing this topic.

hammad khan

  • Newbie
  • *
  • Posts: 8
    • View Profile
    • Email
threads function
« on: September 15, 2013, 12:09:50 pm »
template<typename F >
sf::Thread::Thread    (    F     function   )

Construct the thread from a functor with no argument.

This constructor works for function objects, as well as free function.

Use this constructor for this kind of function:
void function();
// --- or ----
struct Functor
{
void operator()();
};

Note: this does not run the thread, use Launch().
what does the last line mean?

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
Re: threads function
« Reply #1 on: September 15, 2013, 02:50:03 pm »
sf::Thread t(&f); // f is not run
t.launch(); // f is executed here
Laurent Gomila - SFML developer

 

anything