Recently, a new standard was adopted by the ISO for the C++ programming language, called C++11 and based on the C++0x draft. Among various new features, this new standard includes an extensible random number facility containing the Mersenne twister. Some aspects are already implemented in recent versions of libstdc++, and can be tested using
g++ -std=c++0x