Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: Chaste/cppwg
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: develop
Choose a base ref
...
head repository: Chaste/cppwg
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 116-wrap-structs
Choose a head ref
Checking mergeability… Don’t worry, you can still create the pull request.
  • 5 commits
  • 26 files changed
  • 2 contributors

Commits on Aug 5, 2026

  1. #116 Wrap plain structs and expose public data members

    A struct that was not the single-nested-enum special case was silently
    dropped by the class writer (no wrapper file), yet the module writer still
    emitted its #include and register_..._class call, producing an opaque
    missing-header compile error (or the unlinkable-struct mismatch).
    
    Route any non-single-enum struct through the normal py::class_ path (its
    members are public by default), and bind public data members with
    def_readwrite (or def_readonly for const members) via a new
    CppClassMemberWrapperWriter. Static and bitfield members, which have no
    usable address, are skipped; the existing excluded_variables option
    (previously unused) suppresses a named field. The change applies to all
    wrapped classes, not just structs.
    
    package_info._wrapped_types now also walks public data members (same
    skips) so a member type drives dependency pruning and auto-includes,
    keeping it in lockstep with the writers. When a class produces no wrapper
    code at all, warn instead of silently writing nothing.
    
    Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
    kwabenantim and claude committed Aug 5, 2026
    Configuration menu
    Copy the full SHA
    91b8539 View commit details
    Browse the repository at this point in the history
  2. #116 Demonstrate struct data members in the shapes example

    Add a plain data struct ShapeMetrics to the primitives module: mutable
    members bound with def_readwrite, a const member with def_readonly, and a
    field suppressed via excluded_variables. Regenerate the wrappers and add a
    test that constructs the struct, round-trips a field, checks the const
    field is read-only, and confirms the excluded field is absent.
    
    Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
    kwabenantim and claude committed Aug 5, 2026
    Configuration menu
    Copy the full SHA
    b9c1a52 View commit details
    Browse the repository at this point in the history
  3. #116 Document struct wrapping and public data members

    Note that a plain struct is wrapped as a normal class, that public data
    members are exposed with def_readwrite/def_readonly, and that
    excluded_variables suppresses a field.
    
    Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
    kwabenantim and claude committed Aug 5, 2026
    Configuration menu
    Copy the full SHA
    fe33927 View commit details
    Browse the repository at this point in the history
  4. #116 Make example include guards word-separated

    Several example headers used run-together include guards (ABSTRACTPOLYGON_HPP_)
    while others already separated words with underscores (SIMPLE_MATH_FUNCTIONS_HPP_).
    Standardise both example projects on the word-separated form.
    
    Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
    kwabenantim and claude committed Aug 5, 2026
    Configuration menu
    Copy the full SHA
    a416ba7 View commit details
    Browse the repository at this point in the history
  5. #116 Cover struct-wrap edge cases

    Add unit tests for the paths the initial #116 tests missed: a class that
    produces no register blocks (warns, writes nothing), a plain non-struct
    class taking the normal member-binding path, and an abstract class with an
    abstract base whose constructors are not wrapped but whose public data
    members still drive dependency/auto-include resolution.
    
    Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
    kwabenantim and claude committed Aug 5, 2026
    Configuration menu
    Copy the full SHA
    2eecf89 View commit details
    Browse the repository at this point in the history
Loading