Skip to content

Commit

Permalink
Redefine isView via AnyView concept
Browse files Browse the repository at this point in the history
  • Loading branch information
bernhardmgruber committed Aug 10, 2023
1 parent 3e3e546 commit aec5c80
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions include/llama/View.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -580,11 +580,18 @@ namespace llama
Array<BlobType, Mapping::blobCount> m_blobs;
};

#ifdef __cpp_lib_concepts
template<typename View>
inline constexpr auto isView = AnyView<View>;
#else
template<typename View>
inline constexpr auto isView = false;

// this definition does neither capture SubView nor user defined view's, but the issue resolves itself with a C++20
// upgrade.
template<typename Mapping, typename BlobType, typename Accessor>
inline constexpr auto isView<View<Mapping, BlobType, Accessor>> = true;
#endif

namespace internal
{
Expand Down

0 comments on commit aec5c80

Please sign in to comment.