Boost logo

Boost :

From: Vladimir Prus (ghost_at_[hidden])
Date: 2002-10-24 01:02:57


Rémi Chateauneu wrote:
> /* A simple class for processing roman numbers */

I'm not sure that *class* is needed. Something as simple as a function
which converts integer to string would do. Class might be usefull to write

     cout << roman(10) << "\n";

but why have complete class?

(For loading, you can use

     cin >> roman_in(&i)

  or something

> #define ROMAN_MIN 1
> #define ROMAN_MAX 4999

That's hardly good. Why not "const int"?

> friend std::ostream & operator << ( std::ostream & the_o, const
> roman_int_t & the_r ) {

<code snipped>

Two comments:
1. I can't grasp the logic there, and would like to see some test cases
2. The function is implicitly inline. I don't think this is right for a
function of such size.

- Volodya

Boost list run by bdawes at, gregod at, cpdaniel at, john at