raise a runtime error when unable to generate a sensible default collection binding

we can't generate a static assertion so easily here.
Problem is, when forming this type, we don't know if
the user will override and provide a custom binding
in some chained call within the nested DSL.

Might still be able to come up with some clever trick,
like e.g. returing an unsuitable marker type from these
dummy default implementations and then, later on, when
actually building the collection binding, to detect
those marker types and rise a static assert at that point.
This would at least give us a better error message,
and in theory, it should always be possible to
detect this kind of misuse at compile time
This commit is contained in:
Fischlurch 2016-03-24 17:44:58 +01:00
parent 3b116fe6ef
commit 92d4e87ab9

View file

@ -404,15 +404,15 @@
struct _DefaultPayload
{
static bool
match (GenNode const& spec, ELM const& elm)
match (GenNode const&, ELM const&)
{
UNIMPLEMENTED("lalü");
throw error::Logic ("unable to build a sensible default matching predicate");
}
static ELM
construct (GenNode const& spec)
construct (GenNode const&)
{
UNIMPLEMENTED("lalü");
throw error::Logic ("unable to build a sensible default for creating new elements");
}
};