diff --git a/cpp/Platform.Ranges/Range[T].h b/cpp/Platform.Ranges/Range[T].h index d575556..031f6c8 100644 --- a/cpp/Platform.Ranges/Range[T].h +++ b/cpp/Platform.Ranges/Range[T].h @@ -72,8 +72,8 @@ public: template requires std::convertible_to constexpr explicit(not Internal::implicit_convertible_to) operator Range() const noexcept(noexcept(static_cast(Minimum))) { return {static_cast(Minimum), static_cast(Maximum)}; } }; - template - Range(T, U...) -> Range>; + template + Range(T...) -> Range>; } namespace std diff --git a/examples/test_deduction_guide.cpp b/examples/test_deduction_guide.cpp new file mode 100644 index 0000000..f71d828 --- /dev/null +++ b/examples/test_deduction_guide.cpp @@ -0,0 +1,22 @@ +#include "../cpp/Platform.Ranges/Platform.Ranges.h" +#include +#include + +int main() +{ + // Test single parameter deduction + auto range1 = Platform::Ranges::Range(5); + static_assert(std::is_same_v>); + + // Test two parameter deduction + auto range2 = Platform::Ranges::Range(1, 10); + static_assert(std::is_same_v>); + + // Test mixed types deduction + auto range3 = Platform::Ranges::Range(1, 10.5); + static_assert(std::is_same_v>); + + std::cout << "All deduction guide tests passed!" << std::endl; + + return 0; +} \ No newline at end of file