tatami
C++ API for different matrix representations
Loading...
Searching...
No Matches
has_data.hpp
Go to the documentation of this file.
1#ifndef TATAMI_HAS_DATA_HPP
2#define TATAMI_HAS_DATA_HPP
3
4#include <type_traits>
5
11namespace tatami {
12
20template<typename T, class V, typename = int>
21struct has_data {
25 static const bool value = false;
26};
27
35template<typename T, class V>
36struct has_data<T, V, decltype((void) std::declval<V>().data(), 0)> {
40 static const bool value = std::is_same<T*, decltype(std::declval<V>().data())>::value;
41};
42
43}
44
45#endif
Flexible representations for matrix data.
Definition Extractor.hpp:15
auto consecutive_extractor(const Matrix< Value_, Index_ > *mat, bool row, Index_ iter_start, Index_ iter_length, Args_ &&... args)
Definition consecutive_extractor.hpp:35
Compile time check for the data() method.
Definition has_data.hpp:21
static const bool value
Definition has_data.hpp:25