---
title: "Discussion on \"The clamp functions are badly designed\" | Hashnode"
description: "Discussion on \"The clamp functions are badly designed\". Hello ! I'm Xavier Jouvenot and today, we are going to see why the std::clamp and std::ranges::clamp functions of the C++ standard are badly designed and how we can simply improve it.\nSelf promotion:\nHere are a few social networks where you can follo..."
url: "https://hashnode.com/posts/the-clamp-functions-are-badly-designed/633e6cb57b66983d108f2e03"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [The clamp functions are badly designed](https://10xlearner.hashnode.dev/the-clamp-functions-are-badly-designed?utm_source=hashnode&utm_medium=feed)

Hello ! I'm Xavier Jouvenot and today, we are going to see why the std::clamp and std::ranges::clamp functions of the C++ standard are badly designed and how we can simply improve it. Self promotion: Here are a few social networks where you can follo...

Oct 6, 2022 · 4 min read · 10xlearner.hashnode.dev  
Read the article

-   [#cpp](https://hashnode.com/tag/cpp)
-   [#design-principles](https://hashnode.com/tag/design-principles)
-   [#programming-ciovqvfcb008mb253jrczo9ye](https://hashnode.com/tag/programming-ciovqvfcb008mb253jrczo9ye)
-   [#code-quality](https://hashnode.com/tag/code-quality)

## Written by

[Xavier Jouvenot](https://hashnode.com/@Xav83)

@Xav83 · Bordeaux, France

  
[View profile](https://hashnode.com/@Xav83)

Quality Engineer

## Responses

Markdown supported · ⌘↵ to post

No responses yet.
