xieite::toupper()

Defined in header <xieite/data/toupper.hpp>

Converts every character of a string (or a single character) to uppercase.
Only handles the English alphabet.


Declarations

#0
template<xieite::is_ch Char>
[[nodiscard]] constexpr Char toupper(Char c) noexcept;
Makes a single character uppercase. Internally uses a lookup table.

#1
template<typename Char, typename Traits = std::char_traits<Char>, typename Alloc = std::allocator<Char>>
[[nodiscard]] constexpr std::basic_string<Char, Traits, Alloc> toupper(std::basic_string_view<Char, Traits> strv, Alloc&& alloc = {}) noexcept(false);
Makes an entire string uppercase. Internally calls #0.

#2
template<typename Char, typename Traits = std::char_traits<Char>, typename Alloc = std::allocator<Char>>
[[nodiscard]] constexpr auto toupper(const std::basic_string<Char, Traits, Alloc>& str, Alloc&& alloc = {})
	XIEITE_ARROW(xieite::toupper(xieite::str_view(str), XIEITE_FWD(alloc)))
Defers to #1 after deducing Char, Traits, and Alloc.

#3
template<xieite::is_ch Char, typename Traits = std::char_traits<Char>, typename Alloc = std::allocator<Char>, std::size_t length>
[[nodiscard]] constexpr auto toupper(const xieite::group<Char[length]>& str, Alloc&& alloc = {})
	XIEITE_ARROW(xieite::toupper(xieite::str_view<Char, Traits>(str), XIEITE_FWD(alloc)))
Defers to #1 after deducing Char and possibly Alloc.


Example

int main() {
	xieite::dump(xieite::toupper("HeLlO, wOrLd!"));
}
Output:
HELLO, WORLD!
[View in Compiler Explorer]