C++ error: ‘result_of_t’ in namespace ‘std’ does not name a type

  c++, linux, macos, std, windows

Writing a template for a crossplatfrom operation runner.
On Windows the below works perfectly fine, however, when trying to compile on Linux and Mac I get the following error;

error: ‘result_of_t’ in namespace ‘std’ does not name a type

template <typename T, class... TParam>
std::result_of_t<T && (TParam && ...)> Run(T && func, TParam && ... params)
{
...
}

When changing to std::result_of I get compilation issues on Windows, any suggestions how I can write this better?

  • GCC 4.2 Mac
  • GCC 4.6 Linux
  • VS Windows

Source: Windows Questions

LEAVE A COMMENT