-
Notifications
You must be signed in to change notification settings - Fork 126
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
more cuda support for bitvec, vecvec (supports span now)
- Loading branch information
1 parent
b4b8bc7
commit 6b460ae
Showing
3 changed files
with
56 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
#pragma once | ||
|
||
#include <type_traits> | ||
|
||
namespace cista { | ||
|
||
template <class T, class R = void> | ||
struct enable_if_type { | ||
using type = R; | ||
}; | ||
|
||
template <typename T, typename = void> | ||
struct has_const_iterator : std::false_type {}; | ||
|
||
template <typename T> | ||
struct has_const_iterator< | ||
T, typename enable_if_type<typename T::const_iterator>::type> | ||
: std::true_type {}; | ||
|
||
template <typename T> | ||
inline constexpr bool has_const_iterator_v = has_const_iterator<T>::value; | ||
|
||
template <typename Container, typename Enable = void> | ||
struct const_iterator { | ||
using type = typename Container::iterator; | ||
}; | ||
|
||
template <typename Container> | ||
struct const_iterator<Container, | ||
std::enable_if_t<has_const_iterator_v<Container>>> { | ||
using type = typename Container::const_iterator; | ||
}; | ||
|
||
template <typename T> | ||
using const_iterator_t = typename const_iterator<T>::type; | ||
|
||
} // namespace cista |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters