C
Coder Fodder
Hello there.
I have been pondering how one would do such a thing.
For example, the std::set type uses a red-black tree impl.
If I decided that I needed a special impl for set for some
reason, how would one do this ??
So we might have :
// Some function that should be applicable to any impl of set
void doSomething( ?1? theSet)
{
?1?::iterator iter = theSet.begin() ;
// ...
}
std::set<int> s1 ; // the standard STL impl
?2? s2 ; // the special impl of set
doSomething(s1) ;
doSomething(s2) ;
How would ?1? and ?2? be defined and/or implemented ??
Or is the above just not possible (you are stuck with one
impl of every STL type in every program - whatever that may be) ??
Regards
I have been pondering how one would do such a thing.
For example, the std::set type uses a red-black tree impl.
If I decided that I needed a special impl for set for some
reason, how would one do this ??
So we might have :
// Some function that should be applicable to any impl of set
void doSomething( ?1? theSet)
{
?1?::iterator iter = theSet.begin() ;
// ...
}
std::set<int> s1 ; // the standard STL impl
?2? s2 ; // the special impl of set
doSomething(s1) ;
doSomething(s2) ;
How would ?1? and ?2? be defined and/or implemented ??
Or is the above just not possible (you are stuck with one
impl of every STL type in every program - whatever that may be) ??
Regards