Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Eiffel > Re: generics wi...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 7 of 8 Topic 818 of 927
Post > Topic >>

Re: generics with multiple constraints

by Gerald Hammer <Gerald.Hammer@[EMAIL PROTECTED] > Sep 1, 2006 at 11:14 AM

Damian D. wrote:

> 
> Felix Breuer wrote:
>> Hello everyone,
>>
>> suppose I want to create a generic class
>>
>>   A [B -> COMPARABLE  & HASHABLE]
>>
>> meaning that I want classes B that can act as a parameter to A
>> to descend from both COMPARABLE and HASHABLE. How can I
>> achieve this? Eiffel's syntax seems to allow only one constraint per
>> formal parameter. Is there some workaround? This looks like a fairly
>> standard situation to me, so maybe someone encountered this
>> before?
> 
> I do no know the ISE Eiffel class library but I suggest to create a
> class X inheriting COMPARABLE and HASHABLE and use A [B->X]
> 

This would not really solve the problem because then A[INTEGER] would
be illegal, INTEGER not beeing a heir of X.

-- 
Gerald Hammer
 




 8 Posts in Topic:
generics with multiple constraints
"Felix Breuer"   2006-08-31 15:00:17 
Re: generics with multiple constraints
"Bernd Schoeller&quo  2006-09-01 04:17:02 
Re: generics with multiple constraints
Gerald Hammer <Gerald.  2006-09-01 10:40:15 
Re: generics with multiple constraints
"@[EMAIL PROTECTED]   2006-09-01 18:55:40 
Re: generics with multiple constraints
Gerald Hammer <Gerald.  2006-09-01 21:50:34 
Re: generics with multiple constraints
"Damian D." <  2006-09-01 02:00:06 
Re: generics with multiple constraints
Gerald Hammer <Gerald.  2006-09-01 11:14:47 
Re: generics with multiple constraints
"Bernd Schoeller&quo  2006-09-01 20:23:01 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Wed Jul 9 5:55:42 CDT 2008.