Page MenuHomeFeedback Tracker

Compiler fails to instantiate custom nested templates
Assigned, NormalPublic

Description

The compiler doesn't seem to instantiate inner template arguments of custom template classes.

Details

Severity
Minor
Resolution
Open
Reproducibility
Always
Operating System
Windows 11 x64
Category
General
Steps To Reproduce

Trying to compile the code below will throw error: Missing script declaration of class 'MyRefContainer<Managed>':

//------------------------------------------------------------------------------------------------
class MyRefContainer<Class T> : Managed
{
	ref T m_pElement;
}

//------------------------------------------------------------------------------------------------
void RunTest()
{
	MyRefContainer<MyRefContainer<Managed>> m_pMyNestedContainer;
}
Additional Information

A workaround is to force instantiation via typedef:

typedef MyRefContainer<Managed> TManadgedMyRefContainer;

Event Timeline

ookexoo created this task.Thu, Jul 3, 3:17 PM
Geez changed the task status from New to Assigned.Thu, Jul 3, 3:29 PM