OSVR-Core
Concat.h
Go to the documentation of this file.
1 
14 // Copyright 2015 Sensics, Inc.
15 // TypePack is part of OSVR-Core.
16 //
17 // Incorporates code from "meta":
18 // Copyright Eric Niebler 2014-2015
19 //
20 // Use, modification and distribution is subject to the
21 // Boost Software License, Version 1.0. (See accompanying
22 // file LICENSE_1_0.txt or copy at
23 // http://www.boost.org/LICENSE_1_0.txt)
24 //
25 // Project home: https://github.com/ericniebler/meta
26 //
27 
28 #ifndef INCLUDED_Concat_h_GUID_84D1F940_2859_4581_8F5D_16651CB90A21
29 #define INCLUDED_Concat_h_GUID_84D1F940_2859_4581_8F5D_16651CB90A21
30 
31 // Internal Includes
32 #include "List.h"
33 #include "T.h"
34 
35 // Library/third-party includes
36 // - none
37 
38 // Standard includes
39 // - none
40 
41 namespace osvr {
42 namespace typepack {
44  namespace detail {
45  template <typename... Lists> struct concat_ {};
46 
47  template <> struct concat_<> { using type = list<>; };
48 
49  template <typename... List1> struct concat_<list<List1...>> {
50  using type = list<List1...>;
51  };
52 
53  template <typename... List1, typename... List2>
54  struct concat_<list<List1...>, list<List2...>> {
55  using type = list<List1..., List2...>;
56  };
57 
58  template <typename... List1, typename... List2, typename... List3>
59  struct concat_<list<List1...>, list<List2...>, list<List3...>> {
60  using type = list<List1..., List2..., List3...>;
61  };
62 
63  template <typename... List1, typename... List2, typename... List3,
64  typename... Rest>
65  struct concat_<list<List1...>, list<List2...>, list<List3...>, Rest...>
66  : concat_<list<List1..., List2..., List3...>, Rest...> {};
67  } // namespace detail
69 
75  template <typename... Lists> using concat = t_<detail::concat_<Lists...>>;
76 
77 } // namespace typepack
78 } // namespace osvr
79 #endif // INCLUDED_Concat_h_GUID_84D1F940_2859_4581_8F5D_16651CB90A21
The main namespace for all C++ elements of the framework, internal and external.
Definition: namespace_osvr.dox:3
Definition: newuoa.h:1888
Header.
Header.
t_< detail::concat_< Lists... >> concat
Concatenates several lists into a single list.
Definition: Concat.h:75
typename T::type t_
A convenience alias template to extract the nested type within the supplied T.
Definition: T.h:52