Static assert for TX queue entry size

This commit is contained in:
Pavel Kirienko
2014-02-03 14:41:27 +04:00
parent 366ae6397e
commit 9559a9506a
2 changed files with 32 additions and 0 deletions
@@ -0,0 +1,30 @@
/*
* Copyright (C) 2014 Pavel Kirienko <pavel.kirienko@gmail.com>
*/
#pragma once
#include <cassert>
namespace uavcan
{
/**
* Usage:
* StaticAssert<expression>::check();
*/
template <bool VALUE>
struct StaticAssert
{
#if __CDT_PARSER__
static void check() { assert(0); }
#endif
};
template <>
struct StaticAssert<true>
{
static void check() { }
};
}