Typesystem

This is a discussion on Typesystem within the C++ Programming forums, part of the General Programming Boards category; Originally Posted by anon But if you have to do that, wouldn't you lose all the safety that you are ...

  1. #16
    Registered User
    Join Date
    Nov 2006
    Posts
    519
    Quote Originally Posted by anon View Post
    But if you have to do that, wouldn't you lose all the safety that you are after?

    Code:
    Radian r;
    Degree d;
    sqrt(r.get() * d.get());
    Yes. The other option would be to wrap the math libraries to make it usable with the unit-types. I use a bunch of libraries... :/

  2. #17
    Cat without Hat CornedBee's Avatar
    Join Date
    Apr 2003
    Posts
    8,893
    All the buzzt!
    CornedBee

    "There is not now, nor has there ever been, nor will there ever be, any programming language in which it is the least bit difficult to write bad code."
    - Flon's Law

  3. #18
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    21,589
    Quote Originally Posted by CornedBee View Post
    Oh yes, I should have checked Boost. What was your experience like in using that library?
    C + C++ Compiler: MinGW port of GCC
    Version Control System: Bazaar

    Look up a C++ Reference and learn How To Ask Questions The Smart Way

  4. #19
    Cat without Hat CornedBee's Avatar
    Join Date
    Apr 2003
    Posts
    8,893
    I haven't. I'm just subscribed to the mailing list, so I know which new libraries appear.
    All the buzzt!
    CornedBee

    "There is not now, nor has there ever been, nor will there ever be, any programming language in which it is the least bit difficult to write bad code."
    - Flon's Law

Page 2 of 2 FirstFirst 12
Popular pages Recent additions subscribe to a feed

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21