On Fri, 24 Jun 2011, John Peterson wrote:

> On Fri, Jun 24, 2011 at 2:25 PM, Roy Stogner <[email protected]> wrote:
>>
>> Any preference for what we should name a macro whose behavior is
>> essentially "do what libmesh_assert() does even when NDEBUG is
>> defined"?
>
> I think this is called an "if test", right?

Heh, zing!  Yeah, it'd basically be to replace

if (!test)
   {
     print "`test' failed";
     libmesh_error();
   }

>> I'm not sure when we'd get around to using such a thing in the library
>> (maybe sparingly in the MeshInput subclasses?), but in application
>> code at least there's a definite need to always run certain sanity
>> checks on input files and input options; the users who provide invalid
>> input aren't always going to be kind enough to provide it to a
>> devel-mode program.
>
> Sorry, I actually don't understand why you need a macro for code that
> should essentially always execute?

Mostly to turn a bunch of instances of the 3-5 lines above into
one-liners.  Using a macro or function prevents having to retype
"test" (which can be a long complicated expression returning bool),
using a macro keeps the libmesh_here() working right.
---
Roy

------------------------------------------------------------------------------
All the data continuously generated in your IT infrastructure contains a 
definitive record of customers, application performance, security 
threats, fraudulent activity and more. Splunk takes this data and makes 
sense of it. Business sense. IT sense. Common sense.. 
http://p.sf.net/sfu/splunk-d2d-c1
_______________________________________________
Libmesh-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/libmesh-users

Reply via email to