this declaration is ok:
void memberFunction(T& functor, double value)noexcept(noexcept(functor(value)));
for a
template<class T>
class MyClass{
public:
void memberFunction(T& functor, double value)noexcept(noexcept(functor(value)));
};
Let's say that MyClass has a functor data member:
template<class T>
class MyClass{
public:
//ctor
...
void memberFunction(double value);
private:
T functor;
};
I want to write the noexcept specification as I did in the previous case, I tried this:
void memberFunction(double value)noexcept(noexcept(functor(value)));
but the compiler tells me that functor is not the scope. The following doesn't work for analogous reasons:
void memberFunction(double value)noexcept(noexcept(this->functor(value)));
And the following can't work because I have some classes used as T which lacks a default constructor:
void memberFunction(double value)noexcept(noexcept(T()(value)));
The following is syntatically wrong:
void memberFunction(double value)noexcept(noexcept(T::operator(double)));
eve though it pictorically explains well what I want.
Any suggestion? For the moment I gave up with the specification...