Community
cancel
Showing results for 
Search instead for 
Did you mean: 
shachris23
New Contributor I
68 Views

TBB concurrent_queue: forward declaration possible?

Hi,

Is it possible to forward declare TBB concurrent_queue?

I tried this:

namespace tbb { template< class T > class concurrent_queue; }

but that didnt work.

I want to forward declare it because I dont want my code user to have to #include TBB header file.
0 Kudos
1 Reply
ARCH_R_Intel
Employee
68 Views

Quoting - shachris23
Hi,

Is it possible to forward declare TBB concurrent_queue?

I tried this:

namespace tbb { template< class T > class concurrent_queue; }

but that didnt work.

I want to forward declare it because I dont want my code user to have to #include TBB header file.

It's namespace tbb { template class concurrent_queue; }. Even if you do have a forward declaration of it, the TBB header "tbb/concurrent_queue.h" must somehow be included, because template definitions have to be visible at compilation time. The ill-fated "export" keyword in C++98 was supposed to get around this, but I don't know how many vendors actually support it in their compilers.
Reply