Ion
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
static_assert.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define ION__STATIC_ASSERT_CAT0(a, b)   a ## b
 Copyright 2016 Google Inc. More...
 
#define ION__STATIC_ASSERT_CAT1(a, b)   ION__STATIC_ASSERT_CAT0(a, b)
 
#define ION_ATTRIBUTE_UNUSED
 Public macro that causes a compile-time error if expr is false. More...
 
#define ION_PORT_STATIC_ASSERT(expr, message)
 

Macro Definition Documentation

#define ION__STATIC_ASSERT_CAT0 (   a,
 
)    a ## b

Copyright 2016 Google Inc.

All Rights Reserved.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS-IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.ION_PORT_STATIC_ASSERT() is the platform-dependent implementation of the ION_STATIC_ASSERT() macro in ion/base/static_assert.h; see that file for usage details. Use native support if possible.

Note
There is a built-in _Static_assert() macro available in gcc starting with version 4.6, but it is NOT available in g++. Some necessary internal goo to get LINE into the variable name.

Definition at line 40 of file static_assert.h.

#define ION__STATIC_ASSERT_CAT1 (   a,
 
)    ION__STATIC_ASSERT_CAT0(a, b)

Definition at line 41 of file static_assert.h.

#define ION_ATTRIBUTE_UNUSED

Public macro that causes a compile-time error if expr is false.

If we are allowed to use c++11. G++ >= 4.8, in the absence of -Wno-unused-local-typedefs (which is negated by -Wall) will fuss about the typedefs generated here. Tag them as unused.

Definition at line 51 of file static_assert.h.

#define ION_PORT_STATIC_ASSERT (   expr,
  message 
)
Value:
typedef int ION__STATIC_ASSERT_CAT1(static_assert_failed_at_line, __LINE__)[ \
static_cast<bool>(expr) ? 1 : -1] ION_ATTRIBUTE_UNUSED
#define ION_ATTRIBUTE_UNUSED
Public macro that causes a compile-time error if expr is false.
Definition: static_assert.h:51
#define ION__STATIC_ASSERT_CAT1(a, b)
Definition: static_assert.h:41

Definition at line 54 of file static_assert.h.