Skip to content

Conversation

@konard
Copy link
Member

@konard konard commented Sep 12, 2025

Summary

  • Added constructor overload to accept nullptr for Handler parameter in C++ version
  • This matches the nullable behavior already present in the C# version (WriteHandler<TLinkAddress>? handler)
  • Allows creating WriteHandlerState instances with null handlers when no handler is needed initially

Changes Made

C++ (WriteHandlerState.h)

  • Added new constructor: WriteHandlerState(typename TStorage::LinkAddressType $continue, typename TStorage::LinkAddressType $break, std::nullptr_t)
  • Existing null-checking logic in Handle() method already supports nullable handlers
  • No breaking changes to existing API

C# (No changes needed)

  • Already supports nullable handlers via WriteHandler<TLinkAddress>? handler parameter

Test Plan

  • ✅ Created and tested standalone C++ program to verify nullable handler functionality
  • ✅ Verified existing C# tests still pass
  • ✅ Confirmed no compilation errors in C++ version
  • ✅ Validated that existing null-checking logic works correctly

Fixes #102

🤖 Generated with Claude Code

Adding CLAUDE.md with task information for AI processing.
This file will be removed when the task is complete.

Issue: #102
@konard konard self-assigned this Sep 12, 2025
Added constructor overload to accept nullptr for Handler parameter,
matching the nullable behavior already present in the C# version.

This allows creating WriteHandlerState instances with null handlers,
which is useful when no handler is needed initially.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
@konard konard changed the title [WIP] Make nullable Make WriteHandlerState.Handler nullable Sep 12, 2025
@konard konard marked this pull request as ready for review September 12, 2025 22:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Make WriteHandlerState.Handler nullable

2 participants