I know this shouldn't be as difficult as it is simple but for some reason the solution eludes me and I've tried hacking this one for hours (yes hours) now.
Here's the code
object.h
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
#ifndef OBJECT_H
#define OBJECT_H
template <constint value>
class object
{
private:
public:
object();
object( int dummy);
~object();
};
#endif
#include <iostream>
#include "object.h"
constint value = 1;
int main()
{
object<value>* a();//compiles but doesn't output anything
//a = new object< value>( value + 1);//compiler error only if H and cpp
//are separate
return 0;
}
I'm running this on Ubuntu Linux with the g++ compiler.