struct inside a class

Discussion in 'C Programming' started by George2, Feb 27, 2008.

  1. George2

    George2

    Joined:
    Feb 12, 2008
    Messages:
    108
    Hello everyone,


    For the MSDN sample,

    http://msdn2.microsoft.com/en-us/library/2af6btx2.aspx

    Code:
      template <class U>
          struct rebind { typedef stingyallocator<U> other; };
    
    My question is, what is the purpose of defining an internal struct which has only a type? How to use it? Why class U is different from _Ty?

    (I see similar code in STL internal implementation for allocator class, seems like a pattern which I do not know.)


    thanks in advance,
    George
    George2, Feb 27, 2008
    #1
    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. Chris Fogelklou
    Replies:
    36
    Views:
    1,373
    Chris Fogelklou
    Apr 20, 2004
  2. Mark McIntyre

    C beginner: struct inside another struct...

    Mark McIntyre, Apr 21, 2006, in forum: C Programming
    Replies:
    5
    Views:
    667
    Yourko
    Apr 23, 2006
  3. monkeydragon

    Struct inside a struct

    monkeydragon, Dec 18, 2005, in forum: C++
    Replies:
    3
    Views:
    17,860
    Rolf Magnus
    Dec 20, 2005
  4. eselk@surfbest.net

    Struct inside a struct, annonymous?

    eselk@surfbest.net, Jun 7, 2006, in forum: C++
    Replies:
    3
    Views:
    558
    eselk@surfbest.net
    Jun 8, 2006
  5. arnuld

    struct inside struct

    arnuld, Jul 23, 2011, in forum: C Programming
    Replies:
    5
    Views:
    734
    Kleuskes & Moos
    Jul 24, 2011
Loading...

Share This Page