How does Clang implement unordered_sets?

Hi,

I’m new to C++, and I’ve been doing some research on unordered_sets. As I understand, an unordered_set is a hash table that contains a key that is also its value. What I’d like to know is how Clang figures out where objects in unordered_sets go.

Clang is a compiler front-end. unordered_set should be implemented by the
standard library. Is this what you're after:
https://github.com/llvm-mirror/libcxx/blob/master/include/unordered_set ?

Eli

Hi,

    I'm new to C++, and I've been doing some research on unordered_sets. As I understand, an unordered_set is a hash table that contains a key that is also its value.

I’m not sure what you mean, is is a hash_table that contains value. The key is the hash of the value.

See: __hash_table<_Tp, _Hash, _Equal, _Alloc>::__insert_unique() for instance, here: https://llvm.org/svn/llvm-project/libcxx/trunk/include/__hash_table

What I'd like to know is how Clang figures out where objects in unordered_sets go.

clang is just a C++ compiler. The STL container are implemented by the standard library, and clang can work with libstdc++ or libc++ (the link I posted above is the latter).