On Mon, 18 Aug 2014, John Peterson wrote:

> Can C++11 static_assert or some template magic help to generate a
> better error message?
>
> I.e. instead of:
>
> error: calling a private constructor of class
> 'libMesh::Parallel::StandardType<libMesh::Point>'
>
> make the compiler print "Did you forget to include parallel_algebra.h?"

Hmm.. Definitely can't print *which* header failed to be included (if
we had enough information for that then we'd just include the header)
but I might be able to coerce most compilers into printing that the
error is a "missing template specialization (possibly missing
header)".  I'd prefer to save that for post-C++11 libMesh, though;
using static_assert is easier than reimplementing it.

> PS why the word "algebra"?

IIRC that header was originally only for communicating
TypeVector/TypeTensor objects, and for those the name sounds
reasonable.

Why I stuck Point in there rather than creating a new header I don't
recall, nor do I remember why I cut-and-pasted rather than factored
out the similar TypeVector/VectorValue/Point code, but Occam's Razor
says "Roy's lazy".
---
Roy

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

Reply via email to