I just want to compile the following program on Mac OSX 10.8 using Apple clang version 4.1 (tags/Apple/clang-421.11.66):
#include using namespace
You need to use the new libc++, which isn't the default:
libc++
clang++ -stdlib=libc++ threadtest.cpp
(Of course you also need to include iostream, but I assume that wasn't you confusion.)