Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion examples/readme_examples.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ transcode_result<I, O> transcode_to_utf32(I first, S last, O out) {

bool transcode_to_utf32_test() {
std::u8string_view char8_string{u8"\xf0\x9f\x95\xb4\xef\xbf\xbd"};
to_utf16_view<std::u8string_view> utf16_transcoding_view{char8_string};
auto utf16_transcoding_view{char8_string | to_utf16};
std::u32string char32_string{};
auto transcode_result{transcode_to_utf32(utf16_transcoding_view.begin(),
utf16_transcoding_view.end(),
Expand Down
37 changes: 37 additions & 0 deletions include/beman/utf_view/detail/nontype_t_polyfill.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
// SPDX-License-Identifier: BSL-1.0

// Copyright Eddie Nolan and Jonathan Wakely 2023 - 2025.
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE.txt or copy at
// https://www.boost.org/LICENSE_1_0.txt)

#ifndef BEMAN_UTF_VIEW_NONTYPE_T_POLYFILL_HPP
#define BEMAN_UTF_VIEW_NONTYPE_T_POLYFILL_HPP

#include <utility>
#include <version>

namespace beman::utf_view::detail {

#ifdef __cpp_lib_function_ref

template <auto V>
using nontype_t = std::nontype_t<V>;

template<auto V> constexpr auto nontype{std::nontype<V>};

#else

template<auto V>
struct nontype_t {
explicit nontype_t() = default;
};

template<auto V> constexpr nontype_t<V> nontype{};

#endif


} // namespace beman::utf_view::detail

#endif // BEMAN_UTF_VIEW_NONTYPE_T_POLYFILL_HPP
Loading