OSVR-Core
Always.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_Always_h_GUID_0FAFDF98_A560_45B9_A434_D3C02136BA6E
29 #define INCLUDED_Always_h_GUID_0FAFDF98_A560_45B9_A434_D3C02136BA6E
30 
31 // Internal Includes
32 #include "T.h"
33 
34 // Library/third-party includes
35 // - none
36 
37 // Standard includes
38 // - none
39 
40 namespace osvr {
41 namespace typepack {
42 
44  template <typename T> struct always {
45  private:
46  // Redirect through a class template for compilers that have not
47  // yet implemented CWG 1558:
48  // <http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#1558>
49  template <typename...> struct impl { using type = T; };
50 
51  public:
52  template <typename... Ts> using apply = t_<impl<Ts...>>;
53  };
54 } // namespace typepack
55 } // namespace osvr
56 
57 #endif // INCLUDED_Always_h_GUID_0FAFDF98_A560_45B9_A434_D3C02136BA6E
A Alias Class that always returns T.
Definition: Always.h:44
The main namespace for all C++ elements of the framework, internal and external.
Definition: namespace_osvr.dox:3
Header.
typename T::type t_
A convenience alias template to extract the nested type within the supplied T.
Definition: T.h:52