N
Noah Roberts
I have something like the following:
template<ENUM X, int I = 0>
class Generic
{
....
};
typedef Generic<Val1> v1_type;
typedef Generic<Val2> v2_type;
typedef Generic<Val2, 1> incompat_v2_type;
I'm going to be making this class fundamental to the nature of a rather
large project (the goal is to start using it everywhere instead of
something that is currently done). I don't want to have to include the
header every time I have to return a value of this type. I want to
forward declare in headers and include in source files.
class v1_type; does not work.
I'm not that great with templates and don't fully grasp the subtleties
of what I am trying to accomplish. Can I forward declare this template
and use it? I would prefer to do so based on the typedefs, not the
actual template.
template<ENUM X, int I = 0>
class Generic
{
....
};
typedef Generic<Val1> v1_type;
typedef Generic<Val2> v2_type;
typedef Generic<Val2, 1> incompat_v2_type;
I'm going to be making this class fundamental to the nature of a rather
large project (the goal is to start using it everywhere instead of
something that is currently done). I don't want to have to include the
header every time I have to return a value of this type. I want to
forward declare in headers and include in source files.
class v1_type; does not work.
I'm not that great with templates and don't fully grasp the subtleties
of what I am trying to accomplish. Can I forward declare this template
and use it? I would prefer to do so based on the typedefs, not the
actual template.