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 <utility>
5#include <type_traits>
6
12namespace tatami {
13
21template<typename Type_, class Container_, typename = int>
22struct has_data {
26 static const bool value = false;
27};
28
36template<typename Type_, class Container_>
37struct has_data<Type_, Container_, decltype((void) std::declval<Container_>().data(), 0)> {
41 typedef decltype(std::declval<Container_>().data()) DataResult;
49 static const bool value = std::is_same<Type_*, DataResult>::value || std::is_same<const Type_*, DataResult>::value;
50};
51
52}
53
54#endif
Flexible representations for matrix data.
Definition Extractor.hpp:15
Compile time check for the data() method.
Definition has_data.hpp:22
static const bool value
Definition has_data.hpp:26