Skip to content

Conversation

@konard
Copy link
Member

@konard konard commented Sep 13, 2025

Summary

Fixes the Range class template deduction guide to support single parameter construction.

The previous deduction guide:

template<typename T, typename... U>
Range(T, U...) -> Range<std::common_type_t<T, U...>>;

Required at least two parameters (T and U...), but Range has a single-parameter constructor for creating ranges with the same minimum and maximum value.

This change fixes the deduction guide to use variadic template parameters:

template<typename... T>
Range(T...) -> Range<std::common_type_t<T...>>;

This allows both single and multiple parameter deduction to work correctly:

  • Range(5)Range<int>
  • Range(1, 10)Range<int>
  • Range(1, 10.5)Range<double>

Test plan

  • Existing tests in RangeTests.cpp already cover both single parameter (Range(5)) and multiple parameter (Range(1, 3)) construction
  • Created additional test file to verify deduction guide behavior
  • No breaking changes - only extends functionality

Fixes #66

🤖 Generated with Claude Code

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

Issue: #66
@konard konard self-assigned this Sep 13, 2025
The previous deduction guide required at least two parameters (T, U...),
but Range has a single-parameter constructor for creating ranges with
the same minimum and maximum value. This change fixes the deduction
guide to use variadic template parameters (T...) allowing both single
and multiple parameter deduction.

Fixes issue #66

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

Co-Authored-By: Claude <noreply@anthropic.com>
@konard konard changed the title [WIP] Typo – no need two params to deduction guide Fix Range template deduction guide to support single parameter Sep 13, 2025
@konard konard marked this pull request as ready for review September 13, 2025 04:15
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.

Typo – no need two params to deduction guide

2 participants