Template Partial Specialization

Discussion in 'C Programming' started by George2, Nov 19, 2007.

  1. George2

    George2 Guest

    Hello everyone,


    About Template Partial Specialization,

    http://www.cprogramming.com/tutorial/template_specialization.html

    sometimes in real case like below,

    http://www.sgi.com/tech/stl/iterator_traits.html

    there will be two definitions at the same time,

    Code:
    template <typename T>
    class Foo {
    }
    
    template <typename T>
    class Foo <T *>
    {
    }
    
    In theory, compiler will match the latter one with first priority
    compared with the 1st one.

    My question is, I tihnk for basic data types it is easy to match,

    example,

    when we pass Foo <int*>, the latter one is matched and T is int. But
    for arbitrary data types, like used data types, how could compiler
    judge whether a type is pointer (when the latter template class should
    be matched) or not a pointer (when the first template class should be
    matched).


    thanks in advance,
    George
     
    George2, Nov 19, 2007
    #1
    1. Advertising

  2. George2

    Mark Bluemel Guest

    George2 wrote:
    > Hello everyone,
    >
    >
    > About Template Partial Specialization,


    And this has precisely what relationship to the C language?

    This is your third message on comp.lang.c today, as far as I can see,
    which discusses something totally irrelevant to comp.lang.c

    You've been pointed to a more appropriate newsgroup.

    If you only post and don't read, there's little point you bothering.

    Welcome to my killfile.
     
    Mark Bluemel, Nov 19, 2007
    #2
    1. Advertising

  3. George2

    santosh Guest

    In article <fhscb0$61i$>, Mark Bluemel
    <> wrote on Monday 19 Nov 2007 9:36 pm:

    > George2 wrote:
    >> Hello everyone,
    >>
    >>
    >> About Template Partial Specialization,

    >
    > And this has precisely what relationship to the C language?
    >
    > This is your third message on comp.lang.c today, as far as I can see,
    > which discusses something totally irrelevant to comp.lang.c


    And in all, this is the sixth C++ question that the OP has posted to
    comp.lang.c.

    > You've been pointed to a more appropriate newsgroup.
    >
    > If you only post and don't read, there's little point you bothering.
    >
    > Welcome to my killfile.


    He's looking more and more like a troll.
     
    santosh, Nov 19, 2007
    #3
  4. George2

    Mark Bluemel Guest

    santosh wrote:
    (about George2)

    > He's looking more and more like a troll.


    In which case my killfile is an ideal place for him.
     
    Mark Bluemel, Nov 19, 2007
    #4
  5. George2

    Jack Klein Guest

    On Mon, 19 Nov 2007 07:59:22 -0800 (PST), George2
    <> wrote in comp.lang.c:

    > Hello everyone,


    Are you a troll, or just thick?

    As has been pointed out, this is the sixth question about the C++
    language you have asked on comp.lang.c since November 11.

    Five times before you have been told your question belongs in
    comp.lang.c++.

    So either you are trolling, or just plain too stupid to read. Don't
    bother replying as to which it is, I won't see it. Like others here,
    I have given you a well-earned place in my killfile.

    *plonk*

    > About Template Partial Specialization,


    No, about your trolling or stupidity.

    [posted and mailed]

    --
    Jack Klein
    Home: http://JK-Technology.Com
    FAQs for
    comp.lang.c http://c-faq.com/
    comp.lang.c++ http://www.parashift.com/c -faq-lite/
    alt.comp.lang.learn.c-c++
    http://www.club.cc.cmu.edu/~ajo/docs/FAQ-acllc.html
     
    Jack Klein, Nov 19, 2007
    #5
    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. Chandra Shekhar Kumar

    template partial specialization

    Chandra Shekhar Kumar, Jun 24, 2003, in forum: C++
    Replies:
    17
    Views:
    3,030
    tom_usenet
    Jun 25, 2003
  2. Joseph Turian
    Replies:
    2
    Views:
    468
  3. toton
    Replies:
    1
    Views:
    616
  4. vj
    Replies:
    1
    Views:
    485
  5. Hizo
    Replies:
    17
    Views:
    689
    itaj sherman
    Mar 7, 2011
Loading...

Share This Page