static member template

Discussion in 'C++' started by Chris Forone, Jun 9, 2008.

  1. Chris Forone

    Chris Forone Guest

    hello group,

    whats wrong with following static member template:

    class x
    {
    template<typename InputIterator, typename std::valarray<char>&>
    static void Copy(InputIterator file, std::valarray<char>& store);
    };

    if i call:

    Copy(std::istreambuf_iterator<char>(file), meta);

    where meta = std::valarray<char> meta(20);

    i get a no matching function error...

    thanks & hand, chris
     
    Chris Forone, Jun 9, 2008
    #1
    1. Advertising

  2. Chris Forone

    Chris Forone Guest

    Chris Forone schrieb:
    > hello group,
    >
    > whats wrong with following static member template:
    >
    > class x
    > {
    > template<typename InputIterator, typename std::valarray<char>&>
    > static void Copy(InputIterator file, std::valarray<char>& store);
    > };
    >
    > if i call:
    >
    > Copy(std::istreambuf_iterator<char>(file), meta);
    >
    > where meta = std::valarray<char> meta(20);
    >
    > i get a no matching function error...
    >
    > thanks & hand, chris


    class x
    {
    template<typename InputIterator>
    static void Copy(InputIterator file, std::valarray<GLubyte>& store);
    };

    compiles but i get undefined references...
     
    Chris Forone, Jun 9, 2008
    #2
    1. Advertising

  3. Chris Forone

    Chris Forone Guest

    Chris Forone schrieb:
    > Chris Forone schrieb:
    >> hello group,
    >>
    >> whats wrong with following static member template:
    >>
    >> class x
    >> {
    >> template<typename InputIterator, typename std::valarray<char>&>
    >> static void Copy(InputIterator file, std::valarray<char>& store);
    >> };
    >>
    >> if i call:
    >>
    >> Copy(std::istreambuf_iterator<char>(file), meta);
    >>
    >> where meta = std::valarray<char> meta(20);
    >>
    >> i get a no matching function error...
    >>
    >> thanks & hand, chris

    >
    > class x
    > {
    > template<typename InputIterator>
    > static void Copy(InputIterator file, std::valarray<GLubyte>& store);
    > };
    >
    > compiles but i get undefined references...


    Ok, if i include the .cpp file rather the .h file, then it goes...
     
    Chris Forone, Jun 9, 2008
    #3
  4. Chris Forone wrote:
    ....
    > Ok, if i include the .cpp file rather the .h file, then it goes...


    The is an FAQ about this one. Check it out.
     
    Gianni Mariani, Jun 9, 2008
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Frederiek
    Replies:
    1
    Views:
    391
    Thomas Tutone
    Sep 14, 2006
  2. dolphin
    Replies:
    3
    Views:
    1,362
    Pete Becker
    Dec 5, 2007
  3. Hicham Mouline
    Replies:
    0
    Views:
    441
    Hicham Mouline
    Apr 23, 2009
  4. Hicham Mouline
    Replies:
    1
    Views:
    423
    Michael DOUBEZ
    Apr 24, 2009
  5. Replies:
    1
    Views:
    300
Loading...

Share This Page