Turi Create  4.0
is_swriter_base.hpp
1 /* Copyright © 2017 Apple Inc. All rights reserved.
2  *
3  * Use of this source code is governed by a BSD-3-clause license that can
4  * be found in the LICENSE.txt file or at https://opensource.org/licenses/BSD-3-Clause
5  */
6 #ifndef TURI_UNITY_IS_SWRITER_BASE_HPP
7 #define TURI_UNITY_IS_SWRITER_BASE_HPP
8 
9 
10 #include <iterator>
11 #include <type_traits>
12 #include <core/storage/sframe_data/swriter_base.hpp>
13 namespace turi {
14 namespace sframe_impl {
15 
16 
17 /**
18  * \ingroup sframe_physical
19  * is_swriter_base<T>::value is true if T inherits from swriter_base
20  */
21 template <typename T,
22  typename DecayedT = typename std::decay<T>::type,
23  typename Iterator = typename DecayedT::iterator>
25  static constexpr bool value =
26  std::is_base_of<turi::swriter_base<Iterator>, DecayedT>::value;
27 };
28 
29 
30 template <typename T>
31 struct is_swriter_base<T,void,void> {
32  static constexpr bool value = false;
33 };
34 
35 
36 
37 } // sframe_impl
38 } // turicreate
39 
40 #endif