Boost logo

Boost Users :

Subject: [Boost-users] boost::result_of and pure virtual functor leads to compile error
From: oswin krause (oswin.krause_at_[hidden])
Date: 2013-04-29 15:08:32


Hi list,

I am necountering an error when trying to use boost::result_of on a pure
virtual base class.

minimal example:

struct Test{
     typedef int result_type;
     virtual int operator()(int)=0;
};
typedef boost::result_of<Test(int)>::type type;

leads with gcc 4.8 (and with every compiler i know of) to the following
output:

Error: »type name« declared as function returning an abstract class type
  typedef boost::result_of<Test(int)>::type type;

(actually in the original code where this showed up, gcc compiles it
just fine only every other compiler fails, but in this very simple
example, even gcc get's the message...)

Any chance to use result_of in this setting? I clearly can't use the
function call syntax here, which is a little bit annoying.

Greetings,
Oswin


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net