Skip to content

Fix #946: Add standard iterator traits to CharPointer_UTF8 for compat… #1562

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
7 changes: 7 additions & 0 deletions modules/juce_core/text/juce_CharPointer_UTF8.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,13 @@ class CharPointer_UTF8 final
public:
using CharType = char;

// Standard iterator traits for compatibility with STL algorithms
using value_type = juce_wchar;
using pointer = juce_wchar*;
using reference = juce_wchar; // Note: returns by value since this is a proxy iterator
using iterator_category = std::input_iterator_tag;
using difference_type = std::ptrdiff_t;

explicit CharPointer_UTF8 (const CharType* rawPointer) noexcept
: data (const_cast<CharType*> (rawPointer))
{
Expand Down