File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 55#include <meta>
66#include <ranges>
77#include <string_view>
8+ #include <type_traits>
89#include <vector>
910
1011namespace chroma {
@@ -79,7 +80,9 @@ template <typename T>
7980struct callable_from;
8081
8182template <typename Color>
82- concept ignorable = not requires { Color::ignorable; } || Color::ignorable;
83+ concept ignorable =
84+ (not requires { Color::ignorable; } and std::is_default_constructible_v<Color>) or
85+ Color::ignorable;
8386
8487enum struct viability { accepted, rejected, ignored };
8588
Original file line number Diff line number Diff line change @@ -14,4 +14,21 @@ void fnc1(callable_from<A> = {}) {}
1414void test () {
1515 auto a = A ();
1616 fnc1 (a.make_context ());
17+ }
18+
19+ struct B {
20+ static constexpr auto error_message = " not in B" ;
21+
22+ B () = delete ;
23+ explicit B (int ) {}
24+ operator callable_from<B>() const {
25+ return chroma::color<B>();
26+ }
27+ };
28+
29+ void fnc2 (callable_from<B> = {}) {}
30+
31+ void test2 () {
32+ auto b = B (123 );
33+ fnc2 (b);
1734}
You can’t perform that action at this time.
0 commit comments