![]() |
![]() ![]() ![]() ![]() |
![]() |
The MPL Reference Manual: BOOST_MPL_ASSERT_NOTBoost , ,
|
||||||||||||||||||
| Front Page / Macros / Asserts / BOOST_MPL_ASSERT_NOT |
#define BOOST_MPL_ASSERT_NOT( pred ) \ unspecified token sequence \ /**/
Генерирует ошибку компиляции, когда предикат верен.
#include <boost/mpl/assert.hpp>
| Parameter | Requirement | Description |
|---|---|---|
| Предупреждение | Булева нулеваяМетафункция | Предикат, который утверждается как ложный. |
Для любого нуляраМетафункциядо:
BOOST_MPL_ASSERT_NOT(( pred ));
| Return type: | None. |
|---|---|
| Semantics: | Generates a compilation error if pred::type::value != false, otherwise has no effect. Note that double parentheses are required even if no commas appear in the condition. По возможности в пределах диагностических возможностей компилятора сообщение об ошибке будет включать полное имя типа предиката и иметь общую форму: ... ************boost::mpl::not_< pred >::************ ... |
template< typename T, typename U > struct my
{
// ...
BOOST_MPL_ASSERT_NOT(( is_same< T,U > ));
};
my<void,void> test;
// In instantiation of `my<void, void>':
// instantiated from here
// conversion from `
// mpl_::failed************boost::mpl::not_<boost::is_same<void, void>
// >::************' to non-scalar type `mpl_::assert<false>' requested
Статья The MPL Reference Manual: BOOST_MPL_ASSERT_NOT раздела может быть полезна для разработчиков на c++ и boost.
:: Главная :: ::
реклама |