OSVR-Core
SplitList.h
Go to the documentation of this file.
1 
11 // Copyright 2015 Sensics, Inc.
12 // TypePack is part of OSVR-Core.
13 //
14 // Use, modification and distribution is subject to the
15 // Boost Software License, Version 1.0. (See accompanying
16 // file LICENSE_1_0.txt or copy at
17 // http://www.boost.org/LICENSE_1_0.txt)
18 
19 #ifndef INCLUDED_SplitList_h_GUID_471C8D69_CFAD_4083_5485_5DE0EAA24C7F
20 #define INCLUDED_SplitList_h_GUID_471C8D69_CFAD_4083_5485_5DE0EAA24C7F
21 
22 // Internal Includes
23 #include "List.h"
24 
25 // Library/third-party includes
26 // - none
27 
28 // Standard includes
29 // - none
30 
31 namespace osvr {
32 namespace typepack {
33  namespace detail {
35  template <typename... List> struct split_list_ {
36  using head = void;
37  using tail = list<>;
38  };
39 
41  template <typename... List>
42  struct split_list_<list<List...>> : split_list_<List...> {};
43 
45  template <typename Head, typename... Tail>
46  struct split_list_<Head, Tail...> {
47  using head = Head;
48  using tail = list<Tail...>;
49  };
50  } // namespace detail
51 
53  template <typename... List>
54  using head = typename detail::split_list_<List...>::head;
55 
57  template <typename... List>
58  using tail = typename detail::split_list_<List...>::tail;
59 } // namespace typepack
60 } // namespace osvr
61 #endif // INCLUDED_SplitList_h_GUID_471C8D69_CFAD_4083_5485_5DE0EAA24C7F
The main namespace for all C++ elements of the framework, internal and external.
Definition: namespace_osvr.dox:3
typename detail::split_list_< List... >::head head
Get the first element of a list.
Definition: SplitList.h:54
A wrapper for a template parameter pack of types.
Definition: List.h:52
typename detail::split_list_< List... >::tail tail
Get the list without its first element.
Definition: SplitList.h:58
Definition: newuoa.h:1888
Header.
General/dummy case.
Definition: SplitList.h:35