1
1
mirror of https://github.com/mawww/kakoune.git synced 2024-09-11 13:00:41 +03:00

Remove void_t and use requires instead

This commit is contained in:
Maxime Coste 2024-08-09 18:15:32 +10:00
parent a250b96c18
commit 2d9886afe7
2 changed files with 4 additions and 8 deletions

View File

@ -1,17 +1,12 @@
#ifndef meta_hh_INCLUDED
#define meta_hh_INCLUDED
namespace Kakoune
{
inline namespace Meta
namespace Kakoune::inline Meta
{
struct AnyType{};
template<typename T> struct Type : AnyType {};
template<typename T> using void_t = void;
}
}
#endif // meta_hh_INCLUDED

View File

@ -210,11 +210,12 @@ constexpr bool is_direction(RegexMode mode)
(mode & ~(RegexMode::Forward | RegexMode::Backward)) == RegexMode{0};
}
template<typename It, typename=void>
template<typename It>
struct SentinelType { using Type = It; };
template<typename It>
struct SentinelType<It, void_t<typename It::Sentinel>> { using Type = typename It::Sentinel; };
requires requires { typename It::Sentinel; }
struct SentinelType<It> { using Type = typename It::Sentinel; };
template<typename Iterator, RegexMode mode>
requires (has_direction(mode))