Partial Spezialization of member function

From: Paul Schneider (paulibaer_at_uboot.com)
Date: 09/30/04

  • Next message: Thomas Matthews: "Re: Calling functions in other files..."
    Date: Thu, 30 Sep 2004 15:26:59 +0000
    
    

    Hi,

    I am getting compiler errors with the following setup:

    template<size_t N, enum one, enum two, enum three>
    class Myclass {
            double fun();
    };

    template<size_t N, enum one, enum two, enum three>
    double MyClass<N, one, two, three>::fun() { return 0.0;}

    The above compiles fine, but as soon as I want to partially specialize
    my member function with:

    template<size_t N, enum two, enum three>
    double MyClass<N, someenum, two, three>::fun() { return 1.0; }

    I get:

    /home/paultschi/workspace/abcalibration/src/model.cpp:32: error: no
    `double abcalibration::Model<N, EDV, forVola, fxVola>::onePerAlpha()'
    member function declared in class `abcalibration::Model<N, EDV, forVola,
    fxVola>'

    /home/paultschi/workspace/abcalibration/src/model.cpp:32: error:
    template definition of non-template `double abcalibration::Model<N, EDV,
    forVola, fxVola>::onePerAlpha()'

    (replace above names with Myclass and fun)

    I am grateful for any hints on how to do this.

    Cheers,

    Paul


  • Next message: Thomas Matthews: "Re: Calling functions in other files..."

    Relevant Pages

    • Re: how to parse an Enum Structure in vb.net
      ... Public Enum MyEnum ... I save in an access database this enum value as an integer (0=EnumVal1, ... Use a String column in the database and use.ToStringto get the enum "name" to save. ... Class MyClass ...
      (microsoft.public.dotnet.languages.vb)
    • Re: how to parse an Enum Structure in vb.net
      ... You can just as easily assign numbers to each enum value, i.e., ... I save in an access database this enum value as an integer (0=EnumVal1, ... parse the string value ... Class MyClass ...
      (microsoft.public.dotnet.languages.vb)
    • Re: Need help with C2666 error
      ... > I have a large mfc project that has been working fine. ... > an enum and I want to make a vector of these enums: ... > class MyClass { ... > I created a small test app, and there is no problem with this, so it appears ...
      (comp.lang.cpp)
    • Re: regarding nested enums
      ... I have a enum in my program to represent country names and i would ... I suggest you start by showing us a small program illustrating what you ... tried to do and what compiler errors resulted from it. ...
      (comp.lang.c)
    • regarding nested enums
      ... I have a enum in my program to represent country names and i would ... i tried to create one similar to nested structure but i ... landed up with compiler errors, if it is not possible, please let me ...
      (comp.lang.c)