mirror of
https://github.com/boostorg/hof.git
synced 2026-02-01 08:32:12 +00:00
Add a check for default construction
This commit is contained in:
@@ -44,12 +44,14 @@ struct reveal_static_const_factory
|
||||
template<class F>
|
||||
constexpr reveal_adaptor<F> operator=(const F& f) const
|
||||
{
|
||||
static_assert(is_default_constructible<F>::value, "Static functions must be default constructible");
|
||||
return reveal_adaptor<F>(f);
|
||||
}
|
||||
#else
|
||||
template<class F>
|
||||
constexpr const reveal_adaptor<F>& operator=(const F&) const
|
||||
{
|
||||
static_assert(is_default_constructible<F>::value, "Static functions must be default constructible");
|
||||
return static_const_var<reveal_adaptor<F>>();
|
||||
}
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user