#include "header.h"
int main() {
MathFoo::mkFooConst.print();
}
#include "header.h"
//template<> const MathFoo MathFoo::mkFooConst{};
template<> const MathFoo MathFoo::mkFooConst(Bar(0.815));
#include <iostream>
class Bar
{
public:
Bar(float f) {}
};
template<typename T>
class Foo
{
public:
//Foo() { std::cout << "default\n"; }
Foo(const Bar&) { std::cout << "hello\n"; }
void print() const { std::cout << "print()\n"; }
int i = 42;
static const Foo mkFooConst;
};
typedef Foo<float> MathFoo;
template<> const MathFoo MathFoo::mkFooConst; // Declaration