On 09/21/2012 06:09 PM, ZAN DoYe wrote:
> On 2012-09-21 17:25, Sven Barth wrote:
>> In that case you must always pass the type ("keyType" in your example) to
>> tCompOps as well. Anything else does not work. Even generic constraints
>> would not work here.
> Eh? Fpc can specializes C.lessThan, then why can't C.keyType? Hense I request
> this feature :)
And, for example:
> #include <iostream>
>
> using namespace std;
>
> template<typename T>
> class tn {
> public:
> typedef T nt;
> };
>
> template<typename C>
> class to {
> public:
> void sayHi(typename C::nt w) { // prefix a `typename' keyword
> before the nested type which is in a generic class C. It works in cpp.
> cout << w << endl;
> };
> };
>
> int main(int argc, char * argv[])
> {
> to< tn<int> > o;
> o.sayHi(3);
> return 0;
> }
could someone add this handy feature into fpc
_______________________________________________
fpc-devel maillist - [email protected]
http://lists.freepascal.org/mailman/listinfo/fpc-devel