mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-28 11:53:35 +08:00
Explicit noncopyableness, static_assert.hpp --> util.hpp
This commit is contained in:
@@ -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() { }
|
||||
};
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user