Skip to content

v0.6.3

Choose a tag to compare

@sentomk sentomk released this 02 Jan 11:51
· 275 commits to main since this release

🎆Happy NewYear!🎆

Patternia v0.6.3 Release Note

Date: January 2, 2026

What's Changed

Removed Lvalue-Qualified when() Overload

Removed: The const & qualified overload for the when() method has been removed to enforce rvalue-only usage of the match builder.

Previous Behavior (v0.6.2):

// Two overloads existed - rvalue and lvalue
template <typename CaseExpr>
constexpr auto when(CaseExpr &&expr) && { /* rvalue-qualified */ }

template <typename CaseExpr>
constexpr auto when(CaseExpr &&expr) const & { /* lvalue-qualified - REMOVED */ }

New Behavior (v0.6.3):

// Only rvalue-qualified overload remains
template <typename CaseExpr>
constexpr auto when(CaseExpr &&expr) && {
    static_assert(!has_pattern_fallback,
        "[Patternia.match]: no cases may follow a wildcard ('__') pattern");
    
    static_assert(ptn::core::traits::is_case_expr_v<std::decay_t<CaseExpr>>,
        "Argument to .when() must be a case expression created with the '>>' operator");
    
    static_assert(ptn::core::traits::is_handler_invocable_v<std::decay_t<CaseExpr>, subject_type>,
        "Handler signature does not match the pattern's binding result");
    
    using case_t = std::decay_t<CaseExpr>;
    using new_cases = tuple_utils::tuple_append_t<cases_type, case_t>;
    
    using builder_t = match_builder<subject_type, has_match_fallback, new_cases>;
    
    return builder_t{
        std::forward<subject_type>(subject_), std::move(new_cases)};
}

Inhanced Docs

https://patternia.tech


Full release notes: v0.6.3.md