Blaze 3.9
DerivedFrom.h
Go to the documentation of this file.
1//=================================================================================================
33//=================================================================================================
34
35#ifndef _BLAZE_UTIL_CONSTRAINTS_DERIVEDFROM_H_
36#define _BLAZE_UTIL_CONSTRAINTS_DERIVEDFROM_H_
37
38
39//*************************************************************************************************
40// Includes
41//*************************************************************************************************
42
44
45
46namespace blaze {
47
48//=================================================================================================
49//
50// MUST_BE_DERIVED_FROM CONSTRAINT
51//
52//=================================================================================================
53
54//*************************************************************************************************
60#define BLAZE_CONSTRAINT_MUST_BE_DERIVED_FROM(D,B) \
61 static_assert( ( ::blaze::IsBaseOf_v<B,D> ), "Broken inheritance relationship detected" )
62//*************************************************************************************************
63
64
65
66
67//=================================================================================================
68//
69// MUST_NOT_BE_DERIVED_FROM CONSTRAINT
70//
71//=================================================================================================
72
73//*************************************************************************************************
80#define BLAZE_CONSTRAINT_MUST_NOT_BE_DERIVED_FROM(D,B) \
81 static_assert( ( !::blaze::IsBaseOf_v<B,D> ), "Unexpected inheritance relationship detected" )
82//*************************************************************************************************
83
84
85
86
87//=================================================================================================
88//
89// MUST_BE_STRICTLY_DERIVED_FROM CONSTRAINT
90//
91//=================================================================================================
92
93//*************************************************************************************************
101#define BLAZE_CONSTRAINT_MUST_BE_STRICTLY_DERIVED_FROM(D,B) \
102 static_assert( ( ::blaze::IsBaseOf_v<B,D> && !::blaze::IsBaseOf_v<D,B> ), "Broken inheritance relationship detected" )
103//*************************************************************************************************
104
105
106
107
108//=================================================================================================
109//
110// MUST_BE_STRICTLY_DERIVED_FROM CONSTRAINT
111//
112//=================================================================================================
113
114//*************************************************************************************************
122#define BLAZE_CONSTRAINT_MUST_NOT_BE_STRICTLY_DERIVED_FROM(D,B) \
123 static_assert( ( !::blaze::IsBaseOf_v<B,D> || ::blaze::IsBaseOf_v<D,B> ), "Unexpected inheritance relationship detected" )
124//*************************************************************************************************
125
126} // namespace blaze
127
128#endif
Header file for the IsBaseOf type trait.