Forum > General
any workaround of nested generic
(1/1)
powerpcer:
i've container hashmap<TKEY,TVALUE>, vector<T> , point<T>;
but my algorithm need like this
generic aTree<T>=class
type
TPOINT=specialize point<T>;
TVEC=specialize vector<TPOINT>;
TTREEMAP=specialize hashmap<string,TVEC>; <--Error
it shows Error: Generics cannot be used as parameters when specializing generics
Leledumbo:
Please post the full code, I can compile yours (with my own imagination of how point, vector and hashmap should be) even with 3.2.2.
Warfley:
Works without any problem:
--- Code: Pascal [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---type generic point<T>=record end; generic vector<T>=record end; generic hashmap<T,U>=class end; generic aTree<T>=class public type TPOINT=specialize point<T>; TVEC=specialize vector<TPOINT>; TTREEMAP=specialize hashmap<string,TVEC>; end; TIntTree = specialize aTree<Integer>;
Navigation
[0] Message Index