I have a class like this:
struct WorkItemResultData;
template <typename ExecutionPolicy>
class Engine
{
public:
typedef std::shared_ptr<WorkItemResultData> WorkItemResultData_ptr;
}
typedef does not depend on any template argument. Is there a way to use type Engine::WorkItemResultData_ptr outside of Engine class ?
EDIT I know I could use it like awoodland proposed the solution bellow but my typedef is independent of type arguments and want to be able to do it without specifying a specific Engine type.
Yes, but you’ll need to say
typenameif it’s in a template context, e.g.:You can’t access that
typedefwithout a type. There are three workarounds possible though:typedefoutside the template! – it’s likely it doesn’t have much to do with the template if it doesn’t depend on the types.Engine<void>::WorkItemResultData_ptr.