Hi Edgar,

Yes, clearly something like this will work:

  libmesh_example_requires_fun(bool (0),
>                                 "TESTME",
>                                 __FILE__,
>                                 __LINE__);


but you then force the user to manually pass __FILE__ and __LINE__ to every
invocation of the "libmesh_error_msg_fun" function. To me this makes it not
very desirable/useful.

There is also the issue of not being able to "stream" messages into a
function the same way that is possible with macros, for example we often
write code like:

libmesh_error_msg("Invalid shape function index i = " << i);

which is very convenient. If I understand correctly, your original issue
with the macros was that you could not properly "namespace" them, e.g.
libMesh::libmesh_error_msg() does not work, but I think this is a
relatively minor price to pay for the other conveniences that using a macro
provides.

--
John

_______________________________________________
Libmesh-users mailing list
Libmesh-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/libmesh-users

Reply via email to