prog.cpp:6:1: error: non-constant condition for static assertion
static_assert(array.size() == 5, "Fails?");
^~~~~~~~~~~~~
prog.cpp:6:25: error: call to non-constexpr function ‘constexpr std::array<_Tp, _Nm>::size_type std::array<_Tp, _Nm>::size() const [with _Tp = std::function<void()>; long unsigned int _Nm = 5ul; std::array<_Tp, _Nm>::size_type = long unsigned int]’
static_assert(array.size() == 5, "Fails?");
~~~~~~~~~~^~
In file included from prog.cpp:1:0:
/usr/include/c++/6/array:171:7: note: ‘constexpr std::array<_Tp, _Nm>::size_type std::array<_Tp, _Nm>::size() const [with _Tp = std::function<void()>; long unsigned int _Nm = 5ul; std::array<_Tp, _Nm>::size_type = long unsigned int]’ is not usable as a constexpr function because:
size() const noexcept { return _Nm; }
^~~~
/usr/include/c++/6/array:171:7: error: enclosing class of constexpr non-static member function ‘constexpr std::array<_Tp, _Nm>::size_type std::array<_Tp, _Nm>::size() const [with _Tp = std::function<void()>; long unsigned int _Nm = 5ul; std::array<_Tp, _Nm>::size_type = long unsigned int]’ is not a literal type
/usr/include/c++/6/array:90:12: note: ‘std::array<std::function<void()>, 5ul>’ is not literal because:
struct array
^~~~~
/usr/include/c++/6/array:90:12: note: ‘std::array<std::function<void()>, 5ul>’ has a non-trivial destructor