After g++ -std=c++0x
'ing std::result_of
produces the following error message
error: ‘result_of’ in namespace ‘std’ does not name a type
(g++ version 4.5.0 on SUSE.)
The relevant piece of code, sufficient for reproducing the error is below
#include <random>
#include <type_traits>
using namespace std;
class Rnd{
protected:
static default_random_engine generator_;
};
template<class distribution>
class Distr: Rnd{
distribution distribution_;
public:
typename std::result_of<distribution(default_random_engine)>::type
operator() (){ return distribution_(default_random_engine); }
};
Moreover, I have tried to compile examples from wikipedia or cpluplus.com to no avail. Is it a problem with the particular compiler or am I doing something wrong?