Does TBB require C++0x enabled compiler?

Does TBB require C++0x enabled compiler?

Does TBB requires C++0x support in compiler? if so, is there a way to still use TBB templates without C++0x?

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

"Does TBB requires C++0x support in compiler?"

Best Reply

To elaborate on Raf's correct, albeit terse reply, TBB has features to take advantage of lambda support in the compiler but does not require it. Perhaps the biggest visible change to accommodate lambda constructs is in parallel_reduce(), which has a new interface that contains all the components to present a self-contained means for describing a reduction using a pair of lambda constructs. The original interface is still available but requires a separate body class to permit the definition of two user functions for doing the reduction and doing the join, plus a means to initialize private copies of the reduction variable(s) and recover the final result. Compare the current version of the original interface:

    void parallel_reduce( const Range& range, Body& body ) {
     internal::start_reduce::run( range, body, __TBB_DEFAULT_PARTITIONER() );

To the new interface to maximize the advantage of lambda constructs:

    Value parallel_reduce( const Range& range, const Value& identity, const RealBody& real_body, const Reduction& reduction ) {
     internal::lambda_reduce_body body(identity, real_body, reduction);
        internal::start_reduce,const __TBB_DEFAULT_PARTITIONER>
     ::run(range, body, __TBB_DEFAULT_PARTITIONER() );
     return body.result();

So if you're currently using TBB but have not made the transition to a compiler that provides lambda support, you should be just fine. Andwhen you're ready to advance your compiler and try lambdas,TBB will be ready for you .

A place to look for information like this is the TBB manual.

Leave a Comment

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