你能举个例子static_assert(...)来优雅地解决问题吗?
static_assert(...)
我熟悉运行时assert(...).我什么时候应该static_assert(...)比常规更喜欢assert(...)?
assert(...)
此外,boost有一个叫做的东西BOOST_STATIC_ASSERT,它是一样的static_assert(...)吗?
boost
BOOST_STATIC_ASSERT
c++ debugging assert static-assert c++11
assert ×1
c++ ×1
c++11 ×1
debugging ×1
static-assert ×1