From 4017487b8ab8371d3460e978fc203a6d2f50f64b Mon Sep 17 00:00:00 2001 From: liuzicheng1987 Date: Wed, 4 Oct 2023 20:08:24 +0200 Subject: [PATCH] Removed redundancy from header --- docs/variants_and_tagged_unions.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/variants_and_tagged_unions.md b/docs/variants_and_tagged_unions.md index d00a1545..bd04088a 100644 --- a/docs/variants_and_tagged_unions.md +++ b/docs/variants_and_tagged_unions.md @@ -36,7 +36,7 @@ several problems with this: 2) It leads to confusing error messages: If none of the alternatives can be matched, you will get an error message telling you why each of the alternatives couldn't be matched. Such error messages are very long-winding and hard to read. 3) It is dangerous. Imagine we had written `std::variant` instead of `std::variant`. This would mean that `Rectangle` could never be matched, because the fields in `Square` are a subset of `Rectangle`. This leads to very confusing bugs. -## Tagging `std::variant` (externally tagged) +## `std::variant` (externally tagged) From a functional programming point-of-view, the most straightforward way to handle these problems is to add tags.