OSVR-Core
TypePackTestShared.h
Go to the documentation of this file.
1 
11 // Copyright 2015 Sensics, Inc.
12 //
13 // Licensed under the Apache License, Version 2.0 (the "License");
14 // you may not use this file except in compliance with the License.
15 // You may obtain a copy of the License at
16 //
17 // http://www.apache.org/licenses/LICENSE-2.0
18 //
19 // Unless required by applicable law or agreed to in writing, software
20 // distributed under the License is distributed on an "AS IS" BASIS,
21 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
22 // See the License for the specific language governing permissions and
23 // limitations under the License.
24 
25 #ifndef INCLUDED_TypePackTestShared_h_GUID_807AF167_351A_469D_7EA5_14ED183322D8
26 #define INCLUDED_TypePackTestShared_h_GUID_807AF167_351A_469D_7EA5_14ED183322D8
27 
28 // Internal Includes
29 #include <osvr/TypePack/TypePack.h>
30 
31 // Library/third-party includes
32 #include "gtest/gtest.h"
33 
34 // Standard includes
35 #include <type_traits>
36 #include <string>
37 #include <stdint.h>
38 
39 using std::is_same;
40 using std::true_type;
41 using std::false_type;
42 namespace tp = osvr::typepack;
43 
44 // THIS SECTION MUST BE MANUALLY KEPT IN-SYNC!
45 using myhead = uint32_t;
46 using myelt1 = myhead;
47 using myelt2 = int16_t;
48 using myelt3 = bool;
52 
53 static const size_t mylist_len = 3;
54 static_assert(is_same<mylist, tp::coerce_list<myelt1, myelt2, myelt3>>::value,
55  "Coerce list from type pack");
56 // END MANUAL SYNC
57 
58 #endif // INCLUDED_TypePackTestShared_h_GUID_807AF167_351A_469D_7EA5_14ED183322D8
59 
A simple argument-pack-based metaprogramming library, inspired by and based partially on https://eric...
Definition: Always.h:41
A wrapper for a template parameter pack of types.
Definition: List.h:52
Header including all of a simple C++11 template-parameter-pack-based metaprogramming library inspired...
t_< list< Ts... >> coerce_list
Will turn whatever is passed into it into the simplest list.
Definition: CoerceList.h:36