I install the threading building blocks(http://threadingbuildingblocks.org/ver.php?fid=174) in centos in directory /home/is_admin/tbb40_233oss/
This is my code:
#include "tbb/concurrent_queue.h"
#include <iostream>
using namespace std;
using namespace tbb;
int main() {
concurrent_queue<int> queue;
for( int i=0; i<10; ++i )
queue.push(i);
for( concurrent_queue<int>::const_iterator i(queue.begin());
i!=queue.end(); ++i )
cout << *i << " ";
cout << endl;
return 0;
}
I compile the code using this command:
g++ test_concurrent_queue.cpp -I/home/is_admin/tbb40_233od/linux_intel64_gcc_cc4.1.2_libc2.5_kernel2.6.18_release -ltbb -o tcq
but it gives this error:
class tbb::strict_ppl::concurrent_queue<int, tbb::cache_aligned_allocator<int> > has no member named begin
class tbb::strict_ppl::concurrent_queue<int, tbb::cache_aligned_allocator<int> > has no member named end
I cann't find out why? Anybody have tbb experience can help me?