ashvardanian / ashvardanian/StringZilla

Feature: Universal References for Range-Producing Functions

Open
#274 0 comments 0 reactions 0 assignees View on GitHub
enhancement v5
Dominant language
C
Stars
3.6k
Forks
135
PR merge metrics
No merged PRs in 30d

Description

### Describe what you are looking for

We currently accept `const &` arguments in the free-standing range-producing functions like the `find_all` and `rsplit_characters` in `stringzilla.hpp`. That's find for `sz::string_view` arguments, but will produce a copy for memory-owning `sz::string` instances.

It would be great to enable perfect-forwarding, but we can't properly implement it without a ton of SFINAE coming from `` header, limiting what we can do for `SZ_AVOID_STL` builds. In the v5, upgrading to C++ 20 as a baseline, we may be able to implement this more nicely with concepts.

### Can you contribute to the implementation?

- [x] I can contribute

### Is your feature request specific to a certain interface?

C++ bindings

### Contact Details

_No response_

### Is there an existing issue for this?

- [x] I have searched the existing issues

### Code of Conduct

- [x] I agree to follow this project's Code of Conduct

Contributor guide

Open the contributing guide

Research direction

Start in stringzilla.hpp by reading the free-standing range-producing functions, especially find_all and rsplit_characters, and compare their behavior for sz::string_view and owning sz::string arguments. Define what a C++20 concepts-based interface must preserve, including compatibility with SZ_AVOID_STL builds; done means owning strings no longer cause an avoidable copy.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
devtools
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.