@@ -24,13 +24,14 @@ class Square : public Shape { };
2424// --- printing helpers -----------------
2525
2626#line 13 "mixed-type-safety-1.cpp2"
27- template <typename T> auto print (cpp2::impl::in<std::string> msg, T const & x) -> void
28- CPP2_REQUIRES (!(std::convertible_to<T,bool >)) ;
27+ template <typename T> concept non_bool = !(std::convertible_to<T,bool >);
2928
30- #line 17 "mixed-type-safety-1.cpp2"
29+ template <non_bool T> auto print (cpp2::impl::in<std::string> msg, cpp2::impl::in<T> x) -> void;
30+
31+ #line 18 "mixed-type-safety-1.cpp2"
3132auto print (cpp2::impl::in<std::string> msg, cpp2::impl::in<bool > b) -> void;
3233
33- #line 25 "mixed-type-safety-1.cpp2"
34+ #line 26 "mixed-type-safety-1.cpp2"
3435// --- examples -------------------------
3536
3637[[nodiscard]] auto main () -> int;
@@ -39,14 +40,11 @@ auto print(cpp2::impl::in<std::string> msg, cpp2::impl::in<bool> b) -> void;
3940
4041#line 1 "mixed-type-safety-1.cpp2"
4142
42- #line 13 "mixed-type-safety-1.cpp2"
43- template <typename T> auto print (cpp2::impl::in<std::string> msg, T const & x) -> void
44- requires (!(std::convertible_to<T,bool >)) {
45-
4643#line 15 "mixed-type-safety-1.cpp2"
44+ template <non_bool T> auto print (cpp2::impl::in<std::string> msg, cpp2::impl::in<T> x) -> void {
4745 std::cout << msg << x << " \n " ; }
4846
49- #line 17 "mixed-type-safety-1.cpp2"
47+ #line 18 "mixed-type-safety-1.cpp2"
5048auto print (cpp2::impl::in<std::string> msg, cpp2::impl::in<bool > b) -> void
5149{
5250 cpp2::impl::deferred_init<char const *> bmsg;
@@ -55,7 +53,7 @@ auto print(cpp2::impl::in<std::string> msg, cpp2::impl::in<bool> b) -> void
5553 std::cout << msg << cpp2::move (bmsg.value ()) << " \n " ;
5654}
5755
58- #line 27 "mixed-type-safety-1.cpp2"
56+ #line 28 "mixed-type-safety-1.cpp2"
5957[[nodiscard]] auto main () -> int
6058{
6159 ::print (" 1.1 is int? " , cpp2::impl::is<int >(1.1 ));
0 commit comments