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

Go to the source code of this file.

Macros

#define ION_STATIC_ASSERT(expr, message)   ION_PORT_STATIC_ASSERT(expr, message)
 Copyright 2016 Google Inc. More...
 

Macro Definition Documentation

#define ION_STATIC_ASSERT (   expr,
  message 
)    ION_PORT_STATIC_ASSERT(expr, message)

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.Defines ION_STATIC_ASSERT(expr, message) to produce a compile-time error if expr evaluates to false. This uses native support for static assertions if it is available (as is true in gcc with version >= 4.6 or the Microsoft compiler with version > 1600). In this case, the resulting error message should include the message passed to the constructor. If there is no native support, we fall back to a macro defined here that causes a compilation error something like this:

error: size of array 'static_assert_failed_at_lineXXX' is negative

Note
if the macro is used, the expr argument may have to be parenthesized if it contains commas.

Definition at line 35 of file static_assert.h.

Referenced by ion::base::Variant< GLint, GLfloat, math::Range1f, math::Range1i, GraphicsManager::ShaderPrecision, std::vector< GLint > >::ElementsAssignableTo(), ion::base::EnumHelper::GetEnumData(), ion::base::Variant< GLint, GLfloat, math::Range1f, math::Range1i, GraphicsManager::ShaderPrecision, std::vector< GLint > >::Is(), ion::base::Variant< GLint, GLfloat, math::Range1f, math::Range1i, GraphicsManager::ShaderPrecision, std::vector< GLint > >::IsArrayOf(), ion::base::Variant< GLint, GLfloat, math::Range1f, math::Range1i, GraphicsManager::ShaderPrecision, std::vector< GLint > >::IsAssignableTo(), ion::math::Matrix< Dimension, T >::Matrix(), ion::math::VectorBase< Dimension, T >::Set(), and ion::math::VectorBase< Dimension, T >::VectorBase().