
17 Sep
2009
17 Sep
'09
4:05 p.m.
Christoph Mathys wrote:
The compilers handle 'unsigned int' and 'unsigned long' as different types, even though on 32b it is AFAIK the same type.
They are different types, that just happen to be the same size on some systems.
#include <boost/static_assert.hpp> #include <boost/cstdint.hpp>
void someFunc(boost::uint16_t) { } void someFunc(boost::uint32_t) { } void someFunc(std::size_t) { }
Overloading on typedefs are generally not recommended, precisely because you do not know the underlying types. Bo Persson