Sacado Package Browser (Single Doxygen Collection)  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Sacado_mpl_find.hpp
Go to the documentation of this file.
1 // @HEADER
2 // *****************************************************************************
3 // Sacado Package
4 //
5 // Copyright 2006 NTESS and the Sacado contributors.
6 // SPDX-License-Identifier: LGPL-2.1-or-later
7 // *****************************************************************************
8 // @HEADER
9 
10 #ifndef SACADO_MPL_FIND_HPP
11 #define SACADO_MPL_FIND_HPP
12 
13 #include <type_traits>
14 
15 #include "Sacado_mpl_none.hpp"
16 #include "Sacado_mpl_begin.hpp"
17 #include "Sacado_mpl_end.hpp"
18 #include "Sacado_mpl_deref.hpp"
19 #include "Sacado_mpl_next.hpp"
20 #include "Sacado_mpl_if.hpp"
21 
22 namespace Sacado {
23 
24  namespace mpl {
25 
26  template <class Seq, class T>
28 
29  template <class Seq,
30  class T,
31  class Iter1 = typename mpl::begin<Seq>::type,
32  class Iter2 = typename mpl::end<Seq>::type>
33  struct find {
34  typedef typename
36  Iter1,
38  Iter2> >::type type;
39  static const int value = type::value;
40  };
41 
42  template <class Seq, class T, class Iter1>
43  struct find<Seq, T, Iter1, Iter1> {
45  };
46 
47  }
48 
49 }
50 
51 #endif // SACADO_MPL_FIND_HPP
mpl::mpl_if< std::is_same< typename mpl::deref< Iter1 >::type, T >, Iter1, find< Seq, T, typename mpl::next< Iter1 >::type, Iter2 > >::type type
#define T
Definition: Sacado_rad.hpp:553
static const int value
int value