Skip to content

Commit 043e8be

Browse files
committed
remove unignorable flag, remove unchecked access
1 parent c6059c6 commit 043e8be

5 files changed

Lines changed: 0 additions & 97 deletions

File tree

include/chroma

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -45,18 +45,6 @@ constexpr struct {
4545
} eval_rhs;
4646
} // namespace _chroma_util
4747

48-
struct unchecked_context {
49-
template <typename F>
50-
static auto operator()(F&& f) {
51-
return [&]<typename... Ts>[[= unchecked_context{}]](Ts&&... args)
52-
#ifndef __clang__
53-
-> std::invoke_result_t<F, Ts...>
54-
#endif
55-
{ return std::forward<F>(f)(std::forward<Ts>(args)...); };
56-
}
57-
};
58-
constexpr unchecked_context unchecked{};
59-
6048
template <typename... Ts>
6149
struct assumed_colors {};
6250

@@ -95,9 +83,6 @@ consteval viability viability_of(std::meta::info fnc, std::meta::info type) {
9583
auto is_convertible = [&](std::meta::info r) { return is_convertible_type(r, type); };
9684

9785
for (auto annotation : annotations_of(fnc) | std::views::transform(std::meta::type_of)) {
98-
if (annotation == ^^unchecked_context) {
99-
return ignored;
100-
}
10186
if (_chroma_util::is_specialization(annotation, ^^assumed_colors) and
10287
std::ranges::any_of(template_arguments_of(annotation), is_convertible)) {
10388
return accepted;
@@ -134,14 +119,6 @@ template <typename T>
134119
struct callable_from : color<T> {
135120
constexpr explicit(false) callable_from(color<T> const&) {}
136121

137-
constexpr explicit(false) callable_from(unchecked_context const&)
138-
requires ignorable<T>
139-
{}
140-
141-
constexpr explicit(false) callable_from(unchecked_context const&)
142-
requires(not ignorable<T>)
143-
= delete ("unchecked access to unignorable color");
144-
145122
consteval explicit(false)
146123
callable_from(std::meta::access_context ctx = std::meta::access_context::current()) {
147124
if (viability_of(ctx.scope(), ^^T) == viability::rejected) {
@@ -164,8 +141,6 @@ struct callable_from : color<T> {
164141

165142
template <typename T>
166143
struct not_callable_from {
167-
constexpr explicit(false) not_callable_from(unchecked_context) {}
168-
169144
consteval explicit(false)
170145
not_callable_from(std::meta::access_context ctx = std::meta::access_context::current()) {
171146
if (viability_of(ctx.scope(), ^^T) == viability::accepted) {
@@ -184,7 +159,5 @@ struct not_callable_from {
184159
using chroma::assume_color;
185160
using chroma::callable_from;
186161
using chroma::not_callable_from;
187-
using chroma::unchecked;
188162

189-
#define $unchecked ::chroma::_chroma_util::eval_rhs->*[&][[= unchecked]]
190163
#define $with(...) ::chroma::_chroma_util::eval_rhs->*[&][[= assume_color<__VA_ARGS__>]]

test/simple.pass.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,5 @@
33
#include "simple.hpp"
44

55
int main(){
6-
b(unchecked);
76
b(std::meta::access_context::unchecked());
87
}

test/unignorable.pass.cpp

Lines changed: 0 additions & 34 deletions
This file was deleted.

test/unignorable.verify.cpp

Lines changed: 0 additions & 15 deletions
This file was deleted.

test/unignorable2.verify.cpp

Lines changed: 0 additions & 20 deletions
This file was deleted.

0 commit comments

Comments
 (0)