'Using reinterpret_cast function cause E0109 Expression preceding parentheses of apparent call must have (pointer-to-) function type error

I was refactoring a repository, and when I try encapsulating the code in a class:

class A{
    void* p = nullptr;
    void func(int value) {
        return reinterpret_cast<decltype(func)*>(p)(-1);
    }
};

I got this compilation error about reinterpret_cast : E0109 - Expression preceding parentheses of apparent call must have (pointer-to-) function type.
Nothing was wrong until I put the function in the class. What should I do?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source