Skip to Main Content

DevOps, CI/CD and Automation

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

")" expected instead of "0x00000080"

807575Apr 27 2010 — edited Apr 28 2010
Hi everybody outthere,
While trying to compile the following code under SunStudio 11:
template<typename T, typename U=T>
struct UnaryFunc : std::unary_function<T,U>{
    virtual U operator() (T _X) const = 0;
    virtual ~UnaryFunc() {};
};

template<typename T, typename U=T>
struct UnaryFuncWithDerivative : UnaryFunc<T,U>
{
    virtual UnaryFunc<T,U>* Derivative() const = 0;
    virtual ~UnaryFuncWithDerivative() {}
};

template<typename T, typename U=T>
struct UnaryFuncWithNumDerivative : UnaryFuncWithDerivative<T,U>
{
    UnaryFuncWithNumDerivative(const UnaryFunc<T,U>& f, double eps=0.000001)
    : UnaryFuncWithDerivative<T,U>(), itsFunction(f), itsDerivative(new NumderivativeFunc<T,U>(f, eps))
    {}

    // destructor

    virtual U operator() (T _X) const // *Line 72*
    { return itsFunction(_X); }

private:
    // copy constructor
    // operator =

private:
    const UnaryFunc<T,U>& itsFunction;
    UnaryFunc<T,U>* itsDerivative;
}

// Somewhere in another file which I will call ErrorFile
...
    UnaryFuncWithNumDerivative<double> funcWithDeriv(func); // *Line 79*
...
I am getting the following error (_when compiling ErrorFile_):
line 72: Error: ")" expected instead of "0x00000080"
ErrorFille line 79: Where: While specializing "UnaryFunc<double, double>".
ErrorFile line 79: Where: Specialized in non-template code.

Can anyone solve this issue ?

thx,

Edited by: Mhidi on Apr 27, 2010 8:52 AM
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on May 26 2010
Added on Apr 27 2010
3 comments
122 views