Osamu Shigematsu wrote:
> 
> Hello, Eric.
> 
> on 00.6.20 5:27 PM, Erik de Castro Lopo at [EMAIL PROTECTED] wrote:
> 
> > Why? What possible benefit does C++ provide?
> 
> I think C++ has following merits:
> (1) With constructor, we can init member vaules.

This can be done in C. Think about the fopen/fread/fwrite/fgets/fprintf
etc functions. Don't they work like this?

> (2) With destructor, we can dispose resources, such as memory block which
> had been allocated with operator new, or malloc(). Of course, we can close
> file, too.

Isn't this what fclose does?

> (3) To make member values private, we can check the value is valid range.

The user of the above fxxxx function knows nothing of what is contained
in whatever the FILE* pointer points to.

> (4) We can handle error with exception.

That can be done in other ways using C.

> And more. But I know, C++ may little slower than C.

The main problem I have with people suggesting that XXXXXX is ported
from
C to C++ is that usually these people don't know C anywhere near well
enough to criticise it. I am very much in favour of OO programming; I
just
don't think C++ is a good OO programming language.

> To use LAME as library, I have to remove all exit(), so I want to use C++
> exception, i.e.,
> 
> #define exit(x) throw(c_exit_exception(x))
> 
> >> In LAME 3.83beta, there is many exit(), fprintf(stderr, format, ...), or
> >> assert() so I want to make much more reliable for library use.
> >
> > That is a different matter. Yes, it would be well worthwhile fixing
> > these so that LAME can be used as a library.
> 
> I agree. But I don't have cvs access, and I don't know about cvs well.
> So I must fix many lines when newer version will be released.

Have you tried using diff and patch? These two utilities should make
your life very much easier.

> > I am the author of libsndfile
> >
> > http://www.zip.com.au/~erikd/libsndfile/
> 
> Oh, is that so? That great! Thanks for your works.
> 
> > which can optionally be used as the LAME input file decoder. I have for
> > some time thought about added MP3 encoding and decoding to this library
> > but a lack of free time has so far prevented this.
> 
> That's sound nice, but, encoders are needed patent licence, right?
> The free decoders may not be charged according to mp3licences.com.

I'm in Australia where Fraunhoffer and their patents are irrelevant :-).

Cheers,
Erik
-- 
+-------------------------------------------------+
     Erik de Castro Lopo     [EMAIL PROTECTED]
+-------------------------------------------------+
"If you need a piece of paper and a pen to explain it, 
then its not bleedin' obvious" -- Erik's First Law
--
MP3 ENCODER mailing list ( http://geek.rcc.se/mp3encoder/ )

Reply via email to