Skip to content

Tracking issue: C++ standard library function overload compatibility #19

Description

@teor2345

Outreachy Application Process

These instructions are for Outreachy Applicants in October 2026.

IMPORTANT: You must only open one pull request (PR).

Banned AI Usage

Do not use AI to write GitHub descriptions, GitHub comments, code comments, or Zulip chats. Write in your native language, or at your current English level. In your PR description, you must tell us how you used AI. You must review code yourself before you open a PR.

For the best learning experience, write the code yourself, without using AI.

Applicants must follow the Rust Project AI/LLM policy.

Application Steps

Claim a C++ standard library type from the list below by clicking on that issue, then commenting on it. This is the C++ type you will be working on. Before you claim a ticket, make sure no-one else has commented before you.

After each step, push your work to your open PR, make sure CI passes, then wait for 2-4 days for a mentor to review it.
If you need help, post a message in the #outreachy > Overloading Applicant Help Oct 2026 topic on Zulip.

This coding task focuses on Rust and C++ overloads. It is ok to skip drop/destructors (leak memory), use unsafe, and ignore some compiler warnings. Shortcuts and workarounds can be used to simplify non-overload code.

  1. Write Rust wrappers for 3-5 C++ overloads on that type:
    • Create a new file named after your type in overloading-macros/cpp-overload-test/src/stdcpp
    • Wrap constructors first, writing tests to make sure the correct constructor is called
    • Explain any potential compatibility issues in a Limitations doc section
    • Explain usability issues in an Ergonomics doc section
    • Push your changes and wait for a review

For steps 2 and 3, follow the instructions in the PR template.

Focus on Interesting Overloads

Only wrap functions that have overloads. (It is ok to wrap non-overloaded functions just for testing.)

Ignore these overloads:

  • overloaded operators: they are already possible in Rust
  • overloads with an allocator argument, or that only differ by noexcept: not an interesting difference
  • assignment functions, assignment operators, and swap: no equivalent in Rust (which uses memcpy for assignment/swaps)

Only code one example of overloads that:

  • only differ by const/non-const, &/&& (or &/&mut)
  • are iterator methods that only differ by position (before_begin/begin,end)

You can look at stdcpp/forward_list.rs (working overloads) and stdcpp-forward-list.rs (failing overloads) for example code.

C++ Standard Library Types

Each of these types have overloads, we want to check if they can be called from Rust.

containers

Sequence:

Associative:

strings:

numeric:

chrono:

Container Adapters & Views:

Not For Outreachy

extras that mentors might add later

If any classes don't have (interesting) overloads, we can swap them out with one of these. It is still worth merging any analysis of boring classes, particularly overloading markdown table updates.

We should close the project to new contributors before increasing the number of PRs/applicants we need to review.

Similar to other overloads:

Containers:

Associative:

strings

  • wstring
  • u8string
  • u16string
  • u32string
  • wstring_view
  • string_view
  • u16string_view

Container Adapters:

Needs C++23:

not for outreachy

Needs C++26:

Sequence Containers:

These are functions or they don't have many overloads.

numeric:

integer arithmetic functions

  • saturating operations
  • checked operations and their operator equivalents

io

chrono

  • duration - only has overloaded constructors

Trait-like:

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

tracking-issueTracking long-term progress of a project or idea

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions