Author Topic: Lambda functions  (Read 7604 times)

kkerbel

  • Newbie
  • *
  • Posts: 6
    • View Profile
Lambda functions
« on: July 27, 2012, 07:14:06 AM »
Are they possible with this library?  Thanks.

Anthony Williams

  • Administrator
  • Full Member
  • *****
  • Posts: 103
    • View Profile
    • just::thread C++ Thread Library
Re: Lambda functions
« Reply #1 on: July 27, 2012, 08:30:04 AM »
Yes, if your compiler supports lambda functions (e.g. MSVC2010, g++ 4.6) then you can use them with the library. e.g.

Code: [Select]
std::thread t(
    []{
        do_something();
        do_something_else();
    });

kkerbel

  • Newbie
  • *
  • Posts: 6
    • View Profile
Re: Lambda functions
« Reply #2 on: July 28, 2012, 02:20:46 AM »
Thanks!