template function

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Marc Schellens

    template function

    When I feed this to my compiler (gcc 3.2) I got the following error
    message. Whats wrong?
    thanks,
    marc

    template <typename T>
    typename T::ty AssureScalar( EnvT* e, size_t pIx)
    {
    typename T::ty scalar;
    bool isScalar= e->Scalar( scalar);
    return scalar;
    }

    void call( EnvT* e)
    {
    DString callP = AssureScalar<St ringType>( (EnvT*) e, (size_t) 0);
    }




    basic_pro.cpp:1 41: no matching function for call to `AssureScalar(E nvT*,
    size_t)'

  • Victor Bazarov

    #2
    Re: template function

    "Marc Schellens" <m_schellens@ho tmail.com> wrote...[color=blue]
    > When I feed this to my compiler (gcc 3.2) I got the following error
    > message. Whats wrong?[/color]

    When I feed this to my compiler (gcc 3.2) I get much more errors.
    First of them is "EnvT undefined". Care to post complete code?
    [color=blue]
    > thanks,
    > marc
    >
    > template <typename T>
    > typename T::ty AssureScalar( EnvT* e, size_t pIx)
    > {
    > typename T::ty scalar;
    > bool isScalar= e->Scalar( scalar);
    > return scalar;
    > }
    >
    > void call( EnvT* e)
    > {
    > DString callP = AssureScalar<St ringType>( (EnvT*) e, (size_t) 0);
    > }
    >
    >
    >
    >
    > basic_pro.cpp:1 41: no matching function for call to `AssureScalar(E nvT*,
    > size_t)'
    >[/color]


    Comment

    Working...