Numerical Recipes Forum  

Go Back   Numerical Recipes Forum > Numerical Recipes Third Edition Forum > General Problems in Using NR3

Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 07-10-2012, 09:49 AM
ran.rubin ran.rubin is offline
Registered User
 
Join Date: Jul 2012
Posts: 1
hr3.h redefines the throw keyword

While debugging some code I did not write, I encountered some strange compile error with some libstdc standard include files.

It appears that something like:

int f(int arg) throw();

can not be compiled (even though it is correct c++ syntax)

After much effort I found out the source of the problem in the nr3.h file were the throw keyword is defined as a preprocessor macro.

This seems to me a not so good practice since it changes the basic definitions of the language and can (and does) effect other pieces of code not written with NR.

In addition defining it with a macro makes debugging much more difficult...

I suggest to rename the throw macro to NRthrow. This will result with the same functionally without the conflict with other libraries.

I hope you'll continue to give us great guidance and advice regarding numerical computations! Your book is a great resource for every student and scientist!

Ran
Reply With Quote
Reply

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -5. The time now is 03:43 AM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.