std::type_index hash for tbb

std::type_index hash for tbb

Hi,

It would be helpful for c++11 users that TBB provide it's implementation of hashing for std::type_index, so that it can be used as index in tbb::concurrent_unordered_map for example.

Here is the implementation I'm using in one project:

namespace tbb
{
template<>
size_t tbb_hasher( const std::type_index& idx )
{
return std::hash()( idx );
}

}

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