Boost logo

Boost Users :

Subject: [Boost-users] [Lambda, Function, etc] Is static dangerous?
From: Robert Jones (robertgbjones_at_[hidden])
Date: 2011-05-23 08:52:12


Hi All

Is it dangerous to write static Boost.Functions or Boost.Lamda placeholders
in a multi-theaded
context? I think that might be a really stoopid quesion - I'm just checking!

Thx

- Rob.

eg,

#include <boost/function.hpp>
#include <boost/lambda/bind.hpp>

void f( )
{
    namespace ll = boost::lambda;
    using boost::function;

    typedef std::pair<int, int> int_pair;

    static ll::placeholder1_type x;
    static function<int(const int_pair &)> second = ll::bind( &
int_pair::second, x );
}



Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net