Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

to avoid implicit conversion - you can implicitly convert between meters and ft if its like this:

    typedef int feet;
    typedef int meters;
this sucks, because they are the same to the compiler. Making them structs makes them unique types, and you can no longer pass a feet value to a meters parameter, etc.

Its incredibly useful



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: