Skip to content

Commit

Permalink
Added CT::Similar
Browse files Browse the repository at this point in the history
  • Loading branch information
Epixu committed Oct 8, 2023
1 parent 9fa65dd commit 9ad6670
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions source/Core/Common.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -301,6 +301,12 @@ namespace Langulus
concept Same = ::std::same_as<Decay<T1>, Decay<T2>>
and ((::std::same_as<Decay<T1>, Decay<TN>>) and ...);

/// True if unqualified T1 matches all unqualified T2
/// @attention ignores cv-qualifications only
template<class T1, class T2, class... TN>
concept Similar = ::std::same_as<Decvq<Deref<T1>>, Decvq<Deref<T2>>>
and ((::std::same_as<Decvq<Deref<T1>>, Decvq<Deref<TN>>>) and ...);

/// True if T1 matches exactly T2, including density and cv-qualifiers
template<class T1, class T2, class... TN>
concept Exact = ::std::same_as<T1, T2>
Expand All @@ -312,6 +318,12 @@ namespace Langulus
concept SameAsOneOf = ::std::same_as<Decay<T1>, Decay<T2>>
or ((::std::same_as<Decay<T1>, Decay<TN>>) or ...);

/// True if unqualified T1 matches any of unqualified T2
/// @attention ignores cv-qualifications only
template<class T1, class T2, class... TN>
concept SimilarAsOneOf = ::std::same_as< Decvq<Deref<T1>>, Decvq<Deref<T2>>>
or ((::std::same_as< Decvq<Deref<T1>>, Decvq<Deref<TN>>>) or ...);

/// True if T1 matches exactly one of T2, including density and cvq
template<class T1, class T2, class... TN>
concept ExactAsOneOf = ::std::same_as<T1, T2>
Expand Down

0 comments on commit 9ad6670

Please sign in to comment.