@@ -7,22 +7,11 @@ namespace xtd::tests {
77 class test_class_ (stream_insertable_tests) {
88 template <class value_t >
99 requires stream_insertable<value_t >
10- auto is_stream_insertable (value_t && value) -> bool {return true ;}
10+ [[nodiscard]] static auto is_stream_insertable (value_t && value) noexcept -> bool {return true ;}
1111
1212 template <class value_t >
1313 requires (!stream_insertable<value_t >)
14- auto is_stream_insertable (value_t && value) -> bool {return false ;}
15-
16- struct my_stream_insertable {
17- friend auto operator <<(std::ostream& os, const my_stream_insertable&) -> std::ostream& {return os << " my_stream_insertable" ;}
18- };
19-
20- struct my_stringable : public istringable <my_stringable> {
21- auto to_string () const -> string override {return " my_stringable" ;}
22- };
23-
24- struct my_stream_not_insertable {
25- };
14+ [[nodiscard]] static auto is_stream_insertable (value_t && value) noexcept -> bool {return false ;}
2615
2716 auto test_method_ (with_string_literal) {
2817 assert_that (is_stream_insertable (" str" )).is ().true_ ();
@@ -40,15 +29,25 @@ namespace xtd::tests {
4029 assert_that (is_stream_insertable (" 1.2.3" _vers)).is ().false_ ();
4130 }
4231
32+ struct my_stream_insertable {
33+ friend auto operator <<(std::ostream& os, const my_stream_insertable&) -> std::ostream& {return os << " my_stream_insertable" ;}
34+ };
35+
4336 auto test_method_ (with_my_stream_insertable) {
4437 assert_that (is_stream_insertable (my_stream_insertable {})).is ().true_ ();
4538 }
4639
4740 auto test_method_ (with_my_stream_not_insertable) {
41+ struct my_stream_not_insertable {};
42+
4843 assert_that (is_stream_insertable (my_stream_not_insertable {})).is ().false_ ();
4944 }
5045
5146 auto test_method_ (with_my_stringable) {
47+ struct my_stringable : public istringable <my_stringable> {
48+ auto to_string () const -> string override {return " my_stringable" ;}
49+ };
50+
5251 assert_that (is_stream_insertable (my_stringable {})).is ().true_ ();
5352 }
5453
0 commit comments