[ create a new paste ] login | about

Project: lenniedevilliers
Link: http://lenniedevilliers.codepad.org/aR6xi14c    [ raw code | fork ]

lenniedg2000 - C++, pasted on Sep 29:
#include <iostream>

template <class T>
class NumbersOnly
{
private:
    void ValidateType( int    &i ) const{ }
    void ValidateType( long   &l ) const{ }
    void ValidateType( double &d ) const{ }
    void ValidateType( float  &f ) const{ }

public:
    NumbersOnly()
    {
       T valid;
       ValidateType( valid );
    };
};

int main()
{
 NumbersOnly<int> justFine;
 return 0;
}


Output:
No errors or program output.


Create a new paste based on this one


Comments: