This code compiles just fine on my VS express 2008, and does what it should. Is it legal C++ code? I would be very grateful if someone could test it on another compiler.
Just modified it to look more reasonably. Still my question remains, is this standard?
1 2 3 4 5 6 7 8 9 10 11 12
template <class Object, int Function(Object&) >
class A
{
public:
Object x;
A();
};
template <class Object, int Function(Object&)>
A<Object,Function>::A()
{ Function(this->x);
}
[Edit:] Sorry, I didn't clip my original example to the possible minimum. HashedListBasicObjectsSpecifyHashFunction::x was an unwanted artefact from my experimentation.