Explicit noncopyableness, static_assert.hpp --> util.hpp

This commit is contained in:
Pavel Kirienko
2014-02-09 21:28:10 +04:00
parent 56a69a4ba0
commit 017863a32d
7 changed files with 24 additions and 16 deletions
@@ -0,0 +1,39 @@
/*
* Copyright (C) 2014 Pavel Kirienko <pavel.kirienko@gmail.com>
*/
#pragma once
#include <cassert>
namespace uavcan
{
/**
* Usage:
* StaticAssert<expression>::check();
*/
template <bool VALUE>
struct StaticAssert;
template <>
struct StaticAssert<true>
{
static void check() { }
};
/**
* Usage:
* ShowIntegerAsError<integer_expression>::foobar();
*/
template<long N> struct ShowIntegerAsError;
class Noncopyable
{
Noncopyable(const Noncopyable&);
Noncopyable& operator=(const Noncopyable&);
protected:
Noncopyable() { }
};
}