Please see following code and answer

Posted by user323422 on Stack Overflow See other posts from Stack Overflow or by user323422
Published on 2010-04-28T13:16:05Z Indexed on 2010/04/28 13:33 UTC
Read the original article Hit count: 200

Filed under:
template <class T>
class _cExplicitInstation
{

public:
       void show1(T c)
       {
           double d =10.02 ;
           std::cout<<c;
       }
       void show2(T d)
       {
            std::cout<<d;
       }
};


template _cExplicitInstation<char>;
template void _cExplicitInstation<int>::show1(int c);
int main()
{

    _cExplicitInstation<char> abc;
    _cExplicitInstation<int>().show2(10);// it should show error as i have 
        // explicitly declare for show1() function but its working
        // can u tell why?
}

© Stack Overflow or respective owner

Related posts about c++