I'd like to extend array add-on class by adding a T& RandomElement()
method to the class. I could easily modify CScriptArray class interface but it would be easier to add a free method like template<typename T> T& randomElement(CScriptArray*)
instance so that I can extend the behavior without modifying the underlying structure.
Is this possible?