OSVR-Core
And.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_And_h_GUID_9FF8A8BB_A3FE_4EBC_E400_07158E7E3B6D
29 #define INCLUDED_And_h_GUID_9FF8A8BB_A3FE_4EBC_E400_07158E7E3B6D
30 
31 // Internal Includes
32 #include "Bool.h"
33 #include "If.h"
34 #include "T.h"
35 
36 // Library/third-party includes
37 // - none
38 
39 // Standard includes
40 #include <type_traits>
41 
42 namespace osvr {
43 namespace typepack {
44 
46  namespace detail {
47  template <typename... Bools> struct and_impl;
48 
49  template <> struct and_impl<> : std::true_type {};
50 
51  template <typename Bool, typename... Bools>
52  struct and_impl<Bool, Bools...>
53  : if_<bool_<!Bool::type::value>, std::false_type,
54  and_impl<Bools...>> {};
55 
56  } // namespace detail
58 
61  template <typename... Bools> using and_ = t_<detail::and_impl<Bools...>>;
62 
63 } // namespace typepack
64 } // namespace osvr
65 #endif // INCLUDED_And_h_GUID_9FF8A8BB_A3FE_4EBC_E400_07158E7E3B6D
The main namespace for all C++ elements of the framework, internal and external.
Definition: namespace_osvr.dox:3
t_< detail::and_impl< Bools... >> and_
Logically and together all the integral constant-wrapped Boolean parameters, with short-circuiting...
Definition: And.h:61
Definition: gtest_pred_impl_unittest.cc:56
Header.
Definition: newuoa.h:1888
Header.
t_< detail::if_impl< Args... >> if_
Select one type or another depending on a compile-time Boolean integral constant type.
Definition: If.h:61
typename T::type t_
A convenience alias template to extract the nested type within the supplied T.
Definition: T.h:52
Header.