work around some problems with cardinal_of and visual c++