Stride Reference Manual  - generated for commit 9643b11
is_iterator.h
Go to the documentation of this file.
1 /*
2  * This is free software: you can redistribute it and/or modify it
3  * under the terms of the GNU General Public License as published by
4  * the Free Software Foundation, either version 3 of the License, or
5  * any later version.
6  * The software is distributed in the hope that it will be useful,
7  * but WITHOUT ANY WARRANTY; without even the implied warranty of
8  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
9  * GNU General Public License for more details.
10  * You should have received a copy of the GNU General Public License
11  * along with the software. If not, see <http://www.gnu.org/licenses/>.
12  *
13  * Copyright 2018, Kuylen E, Willem L, Broeckhove J
14  * Author bistromatics/Robin Jadoul.
15  */
16 
22 #pragma once
23 
24 #include <iterator>
25 #include <type_traits>
26 
27 namespace stride {
28 namespace util {
29 
30 // This ought to be redundant, but ApplClang does not have the std::void_t yet so ...
31 namespace ii_detail {
32 template <typename... Ts>
33 struct make_void
34 {
35  typedef void type;
36 };
37 template <typename... Ts>
38 using void_t = typename make_void<Ts...>::type;
39 } // namespace ii_detail
40 
42 template <class T, class = void>
43 struct is_iterator : std::false_type
44 {
45 };
46 
48 template <class T>
49 struct is_iterator<T, ii_detail::void_t<typename std::iterator_traits<T>::iterator_category>> : std::true_type
50 {
51 };
52 
53 } // namespace util
54 } // namespace stride
typename make_void< Ts... >::type void_t
Definition: is_iterator.h:38
When it &#39;s not an iterator.
Definition: is_iterator.h:43
Namespace for the simulator and related classes.
Definition: Calendar.cpp:28