Boost logo

Boost :

From: Andras Erdei (aerdei_at_[hidden])
Date: 2005-03-10 15:57:36


what would you say to this:

namespace rational
{

    template < class unlimited >
  class unlimited
    {
      //...
    } ;

  enum policy
    {
      round ,
      round_and_exactness ,
      exception ,
      assert
    } ;

  // for power users
    template < typename limited , policy rounding = round >
  class fxs_
    {
      //...
    } ;

  typedef __int64 biggest_builtin ;

  // for end-users
    template < biggest_builtin limit = INT_MAX , policy rounding = round >
  class fxs
      : public fxs_< fastest type that can hold [-limit...limit] , rounding >
    {
      //...
    } ;

  // if you are really desperate and want to specify by hand
  // the num_type, den_type, num_min, num_max, den_min, den_max etc
  // there is a way to create your own policy blob

  // of course we need better names than fxs and fxs_

}

br,
andras


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk