OSVR-Core
BasicTypeTraits.h
Go to the documentation of this file.
1 
14 // Copyright 2016 Sensics, Inc.
15 //
16 // Licensed under the Apache License, Version 2.0 (the "License");
17 // you may not use this file except in compliance with the License.
18 // You may obtain a copy of the License at
19 //
20 // http://www.apache.org/licenses/LICENSE-2.0
21 //
22 // Unless required by applicable law or agreed to in writing, software
23 // distributed under the License is distributed on an "AS IS" BASIS,
24 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
25 // See the License for the specific language governing permissions and
26 // limitations under the License.
27 
28 #ifndef INCLUDED_BasicTypeTraits_h_GUID_BB01797C_21D1_47B6_9B75_EAA829C6CB2E
29 #define INCLUDED_BasicTypeTraits_h_GUID_BB01797C_21D1_47B6_9B75_EAA829C6CB2E
30 
31 // Internal Includes
32 // - none
33 
34 // Library/third-party includes
35 // - none
36 
37 // Standard includes
38 // - none
39 
40 namespace osvr {
41 namespace util {
42 
44  template <bool, class T = void> struct EnableIf {};
45  template <class T> struct EnableIf<true, T> { typedef T type; };
46 
48  template <bool, class Then, class Else> struct Conditional {
49  typedef Then type;
50  };
51  template <class Then, class Else> struct Conditional<false, Then, Else> {
52  typedef Else type;
53  };
54 
55 } // namespace util
56 } // namespace osvr
57 #endif // INCLUDED_BasicTypeTraits_h_GUID_BB01797C_21D1_47B6_9B75_EAA829C6CB2E
Definition: RunLoopManager.h:42
The main namespace for all C++ elements of the framework, internal and external.
Definition: namespace_osvr.dox:3
Quick C++11-aligned conditional (if/then/elese) implementation.
Definition: BasicTypeTraits.h:48
Quick C++11-aligned enable_if implementation.
Definition: BasicTypeTraits.h:44