Compiler error I don't understand

Hi,

I had something like this working previously, but now i get an error. I'm trying to set up a call back

 class parseAscii
{
  using SomeEvent = void (*)(uint8_t); //type aliasing

  public:
    void RegisterCallback(SomeEvent InEvent)
    {
      BtnEvent = InEvent;
    }

And the error that I get is

AscClockSpoof.h:6:29: error: expected ';' before '(' token

   using SomeEvent = void (*)(uint8_t); //type aliasing

                             ^

If I make it void(*)(); I don't get the error.

The context of this is that this is one class of a fairly large compile and I don't know if there's some pollution from another file, but I haven't seen this before. Any suggestion are welcome. I've been searching for a while.

wish you posted the entire file; line # 6 is the one with using?

isn't "using" intended to describe a name space? looks like your associating it with an unnamed function pointer.

what are you trying to do?

dduehren:
If I make it void(*)(); I don't get the error.

The function signature you passed in must match that of the declaration.

wouldn't a function pointer for defined as follows, for example

   void (*someEvent)(uint8_t);
using SomeEvent = void (*)(uint8_t);

is C++ version of

typedef void (*SomeEvent)(uint8_t);

Perhaps I should have posted the entire file. I think the problem was related to where in the file it was located. And I was moving things around too much. Its working now, but your suggestion might be a better way. If I were a real programmer I think I'd have figured it out myself.

Thanks,

David

dduehren:
Perhaps I should have posted the entire file.

yes

Perhaps I should have posted the entire file. I think the problem was related to where in the file it was located. And I was moving things around too much. Its working now, but your suggestion might be a better way. If I were a real programmer I think I’d have figured it out myself.

Thanks,

David