+ Reply to Thread
Results 1 to 2 of 2

Thread: What is partial specialized template?

  1. #1

    What is partial specialized template?

    What is partial specialized template?

    Give me example.

  2. #2
    Senior Member
    Join Date
    Feb 2012
    Posts
    109
    In below example, int is specified as a template argument of the class rather than using 'typename' keyword.

    This is called partial specialized template.

    Example:

    Code:
    template<typename T, int SIZE>
    class CStack
    {
    private:
    	T m_Data[SIZE] ;
    
    public:
    	CStack() {} ;
    } ;
    
    void UseStack()
    {
          CStack<std::string, 10> objStack ;
    }

+ Reply to Thread

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts