Search code examples
c++observer-pattern

access declaration can only be applied to a base class member


i'm using the observer pattern. I've a class that implements the publisher class:

class foo : public Publisher<const RecoveryState &>,
       public Publisher<char &>,

therin in try to bind the attach function:

using Publisher<const RecoveryState &>::attach;
using Publisher<const char &>::attach;

the RecoveryState works, but at the char line the following error occurs:

Error 5 error C3210: 'Publisher' : access declaration can only be applied to a base class member c:\projekte\ps3controlmodule\tbfcontrol\tbfcmdhandler.h 363


Solution

  • There is a discrepancy "char&" vs. "const char&".