この簡単な例をコンパイルすることはできません (VS 2008 で):
#include <boost/interprocess/sync/named_condition.hpp>
#include <boost/thread/mutex.hpp>
#include <string>
int main(int argc, const char* argv)
{
boost::interprocess::named_condition cond(boost::interprocess::create_only, "somd.notify");
boost::mutex the_mutex;
while (true)
{
const boost::system_time timeout = boost::get_system_time() + boost::posix_time::milliseconds(500);
boost::mutex::scoped_lock lock(the_mutex);
if (cond.timed_wait(lock, timeout))
{
// Do something useful
}
}
return 0;
}
私が得るコンパイルエラーは(boost v1.38.0)です:
1>....\boost/interprocess/sync/named_condition.hpp(326) : error C2273: 'function-style cast' : illegal as right side of '->' operator
1> ..\src\main.cpp(13) : see reference to function template instantiation 'bool boost::interprocess::named_condition::timed_wait<boost::mutex::scoped_lock>(L &,const boost::posix_time::ptime &)' being compiled
1> with
1> [
1> L=boost::mutex::scoped_lock
1> ]
アイデア?