[ create a new paste ] login | about

Link: http://codepad.org/ycUPIxNy    [ raw code | output | fork ]

C++, pasted on Dec 9:
#include <iostream>
#include <string>


template< class Dummy >
class FooConstants_
{
protected:
    static double const someDouble;
};

template< class Dummy >
double const FooConstants_< Dummy >::someDouble = 1.0;


class Foo
    : private FooConstants_< void >
{
public:
    static double aNumber() { return someDouble; }
};


int main()
{
    using namespace std;
    cout << Foo::aNumber() << endl;
}


Output:
1
1


Create a new paste based on this one


Comments: