Skip to content

Commit

Permalink
Drop more unused char_traits<std::byte functions. (#794)
Browse files Browse the repository at this point in the history
Like `length()`, these functions make no sense for binary data.  So
we're better off risking a link error by leaving them undefined, than
defining them and risking them actually gettnig used.
  • Loading branch information
jtv committed Feb 10, 2024
1 parent 376124a commit 1445b97
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions include/pqxx/util.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -330,18 +330,17 @@ struct byte_char_traits : std::char_traits<char>
return static_cast<std::byte*>(std::memset(dest, static_cast<int>(value), size));
}

static int_type not_eof(int_type value)
{
return eq_int_type(value, eof()) ? ~eof() : value;
}
/// Declared but not defined: makes no sense for binary data.
static int_type not_eof(int_type value);

static std::byte to_char_type(int_type value) { return std::byte(value); }

static int_type to_int_type(std::byte value) { return int_type(value); }

static bool eq_int_type(int_type a, int_type b) { return a == b; }

static int_type eof() { return int_type(EOF); }
/// Declared but not defined: makes no sense for binary data.
static int_type eof();
};

template<typename TYPE, typename = void>
Expand Down

0 comments on commit 1445b97

Please sign in to comment.