views:

54

answers:

1

I'm using .NET 3.5 to create an application that requires a Stack<T> with unique values. I realize I could call Contains() before every Push(), but it makes sense semantically that I roll my own "unique stack" (UniqueStack<T> or maybe HashStack<T>?). I'm having a hard time to determine a strong name for this data structure.

I hate the fact that Stack<T> doesn't implement some IStack<T>...

Thoughts are appreciated.

+2  A: 
  • ExclusiveStack?
  • DistinctStack?

Personally, I like your UniqueStack or UniqueItemStack

fletcher
@fletcher - I'll accept this as answer since I will go with `UniqueStack<T>`.
TheCloudlessSky