Templates???

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Rupert harrison

    Templates???

    How would i template the object of my class BSTree, which is defined
    outside my class.
    template <class xtype>
    class BSTree
    {

    class TNode
    {
    TNode *right;
    TNode *left;

    public:
    char *info;

    friend class BSTree <xtpye>;
    };

    Tnode *root


    };
    static BSTree mark

    (eg. static BSTree mark) so that it has access to my functions in main.?



  • Gianni Mariani

    #2
    Re: Templates???

    Rupert harrison wrote:[color=blue]
    > How would i template the object of my class BSTree, which is defined
    > outside my class.[/color]

    English please. :-)

    Sorry, but I really don't understand the context of your question. Your
    refer to "my class" and you refer to a template and there is one below
    which seems to be what you're interested in but I don't get how they are
    supposed to be related.
    [color=blue]
    > template <class xtype>
    > class BSTree
    > {
    >
    > class TNode
    > {
    > TNode *right;
    > TNode *left;
    >
    > public:
    > char *info;
    >
    > friend class BSTree <xtpye>;
    > };
    >
    > Tnode *root
    >
    >
    > };
    > static BSTree mark
    >
    > (eg. static BSTree mark) so that it has access to my functions in main.?[/color]

    What are you trying to do ?
    [color=blue]
    >
    >
    >[/color]

    Comment

    Working...