13.12.2015, 17:02
For those interested in function overloading, there is a tutorial https://sampforum.blast.hk/showthread.ph...pid3459023" target="_blank">here.
You can have syntax like C++ templates too, I have been working on STL plugin and managed to achieve syntax similar to the following by manipulations using defines:
You can have syntax like C++ templates too, I have been working on STL plugin and managed to achieve syntax similar to the following by manipulations using defines:
Код:
list<Float> float_list; //equivalent to new new List:lst_float_list = STL_List_DT_Template_Float; //STL_List_DT_Template has a unique negative number which is of course invalid but it is used to identify the type when a method is used on the list for the first time //Acts as a explicit constructor list::float_list(); //has 3 overloads For local lists, one can have following syntax (Work in progress, having some issue with it) list<String> strings(params); //For local variables, implicit constructor //translates to new List:lst_strings = STL_List_DT_Template_String; //list::strings(params) - basically calls the init function automatically list::strings.push_back("String"); //This translates to _epl_list_push_back(lst_strings, "String");