Is there any easy and elegant way to prevent a direct call to new() for a given type?
The only way I can think of is to do something like this
The only way I can think of is to do something like this
Strict Type TestType Global indirect_call:Int Method New() Assert(indirect_call) 'this fails if indirect_call is 0 or false EndMethod Function Create:TestType() indirect_call = True Local t:TestType = New TestType indirect_call = False Return t EndFunction EndType