
24 Apr
2010
24 Apr
'10
3:52 p.m.
Slawomir Lisznianski skrev:
Thorsten Ottosen wrote: Consider also to reorder your template arguments to make the interface
as close to normal maps as possible.
The intention was that the token-type, being limited to an integral type, would default to an int which would work for vast majority of cases. So the user could simply write:
tokenmap<my_class> fast_map;
instead of:
tokenmap<int, my_class> fast_map;
The second may give an impression that the key can be anything other, whereas in reality it's quite limiting.
I don't feel strong about either method though.
Is suggest that you use BOOST_STATIC_ASSERT and a type_trait to make the requirement checked and explicit. And to make the syntax mimic that of normal maps. -Thorsten