Thread: differences between Partial Explicit Specializations

  1. #1
    Registered User
    Join Date
    Jan 2006
    Posts
    61

    differences between Partial Explicit Specializations

    Hi
    I am reading template chapter in c++.
    We can specizlize a primary template both Partial and Explicit.
    But what are the differences?Advantages and disadvantages.?

    Thanks

  2. #2
    (?<!re)tired Mario F.'s Avatar
    Join Date
    May 2006
    Location
    Ireland
    Posts
    8,446
    A partial template is a version of a class template where some (not all) of the template parameters are specified. The advantages are obvious, since you may want to "fix" some of the parameters to certain data types.

    Code:
    template <class myClass1, class myClass2>
    class some_template {
        /* ... */
    };
    
    // a partial specialization: fixes 2nd parameter as int. First parameter varies
    template <class myClass1>
    class some_template<myClass1, int> {
        /* ... */
    };
    Originally Posted by brewbuck:
    Reimplementing a large system in another language to get a 25% performance boost is nonsense. It would be cheaper to just get a computer which is 25% faster.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. More explicit template member function hell
    By SevenThunders in forum C++ Programming
    Replies: 1
    Last Post: 03-17-2009, 10:36 PM
  2. stdio differences windows vs linux
    By keira in forum C Programming
    Replies: 6
    Last Post: 09-14-2008, 04:42 PM
  3. Interesting behavior with explicit copy constructor
    By Clairvoyant1332 in forum C++ Programming
    Replies: 1
    Last Post: 04-28-2008, 03:19 PM
  4. Replies: 6
    Last Post: 08-12-2007, 01:02 PM
  5. Post...
    By maxorator in forum C++ Programming
    Replies: 12
    Last Post: 10-11-2005, 08:39 AM