including <tbb/compat/condition_varialbe> using gcc 4.7.2 with -std=c++0x

including <tbb/compat/condition_varialbe> using gcc 4.7.2 with -std=c++0x

Hello,

I think the conditional compilation code in tbb_config.h to set TBB_IMPLEMENT_CPP0X needs to be reviewed.

I tried to compile using gcc 4.7.2 with the -std=c++0x flag and got the following error.

error: ‘condition_variable’ in namespace ‘std’ does not name a type

Setting TBB_IMPLEMENT_CPP0X to 1 fixed the problem.

Thanks,

5 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.

Could you please post a minimal code that reproduce the problem ? Without it it is hard solve the problem for sure.

 

 

Based on the original message it seems that you try to use C++11 std::condition_variable without including appropriate header (<condition_variable>).

 

Please note that "tbb/compact/condition_variable" does not include C++11 <condition_variable> header file, neither does other TBB headers.
       

 

 

hello, you need to include compiler's <condition_variable>.

--Vladimir

So in other words if the C++11 standard is defined all TBB code gets disabled and it's the programmer's responsibility to include the header files?

One could argue that logic should go into TBB so the programmer always uses the TBB header file and TBB decides when to use what.

Pardon my late question, I just ran into the same problem this week.

hello, you can to define TBB_IMPLEMENT_CPP0X explicitly to force tbb to use C++0x compatibility classes in C++11 mode of compiler otherwise it is disabled to avoid compatibility problems.

you can submit a patch with your vision of compatibility classes behavior via our contribution form https://www.threadingbuildingblocks.org/submit-contribution, then we can review it.

--Vladimir

Leave a Comment

Please sign in to add a comment. Not a member? Join today