Skip to content

Commit

Permalink
Make better use of CTAD. IWYU on the unit test sources.
Browse files Browse the repository at this point in the history
  • Loading branch information
paulhuggett committed Jan 7, 2024
1 parent 94e763e commit 9250cd4
Show file tree
Hide file tree
Showing 6 changed files with 134 additions and 108 deletions.
11 changes: 5 additions & 6 deletions tests/demo8/demo8.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,8 @@ void c3 () {
void c4 () {
std::vector<char16_t> out;
icubaby::t8_16 t;
std::array<icubaby::char8, 4> const in{static_cast<icubaby::char8> (0xF0), static_cast<icubaby::char8> (0x9F),
static_cast<icubaby::char8> (0x98), static_cast<icubaby::char8> (0x80)};
std::array const in{static_cast<icubaby::char8> (0xF0), static_cast<icubaby::char8> (0x9F),
static_cast<icubaby::char8> (0x98), static_cast<icubaby::char8> (0x80)};
auto it = icubaby::iterator{&t, std::back_inserter (out)};
for (auto cu : in) {
*(it++) = cu;
Expand All @@ -100,8 +100,8 @@ void c4 () {
}

void c5 () {
std::array<icubaby::char8, 4> const in{static_cast<icubaby::char8> (0xF0), static_cast<icubaby::char8> (0x9F),
static_cast<icubaby::char8> (0x98), static_cast<icubaby::char8> (0x80)};
std::array const in{static_cast<icubaby::char8> (0xF0), static_cast<icubaby::char8> (0x9F),
static_cast<icubaby::char8> (0x98), static_cast<icubaby::char8> (0x80)};
std::vector<char16_t> out;
icubaby::t8_16 t;
#if __cpp_lib_ranges
Expand All @@ -115,9 +115,8 @@ void c5 () {
} // namespace

int main () {
using namespace std::string_view_literals;
icubaby::char8 const* in = u8"こんにちは世界\n";
show (std::cout, std::basic_string_view<icubaby::char8> (in));
show (std::cout, std::basic_string_view (in));
show (std::cout, *convert (in));
show (std::cout, *convert2 (in));
c3 ();
Expand Down
Loading

0 comments on commit 9250cd4

Please sign in to comment.