Boost logo

Boost :

Subject: Re: [boost] [GSoC] [Boost.Hana] Formal review request
From: pfultz2 (pfultz2_at_[hidden])
Date: 2014-08-01 07:27:08

> I am therefore rather sticking with static_assert to enforce constraints
> with friendly error messages for the time being until Concepts Lite are
> available as TS or part of the standard.

Using static_assert to enforce constraints can become problematic when used
with concept predicates. That is because static_assert causes a hard error.
So, when its combined with function overloading, I would get a friendly
message, rather than the compiler calling the alternative function. This can
be workaround by specializing the trait, which is possible with Tick, but
with `concept bool`.

A lot of these problems will start showing up as more people start using
concept predicate in C++11 and beyond. The difference between a hard error
template constraint is not really fully understood or utilized by many
libraries. So to be prepared for the future you should use enable_if which
a template constraint, instead of static_assert which just produces an
Most modern compilers will produce nice friendly messages for enable_if.

View this message in context:
Sent from the Boost - Dev mailing list archive at

Boost list run by bdawes at, gregod at, cpdaniel at, john at