[libcxx-commits] [PATCH] D115282: [libc++] Extract __clamp_to_integral to its own header

Louis Dionne via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Tue Dec 7 14:56:43 PST 2021


ldionne added inline comments.


================
Comment at: libcxx/include/module.modulemap:670
       module adjacent_difference      { private header "__numeric/adjacent_difference.h" }
+      module clamp_to_integral        { private header "__numeric/clamp_to_integral.h" }
       module exclusive_scan           { private header "__numeric/exclusive_scan.h" }
----------------
Quuxplusone wrote:
> `__numeric` seems like a weird place for this, since IIUC it's actually used only in `<random>`. Shouldn't it go in `__random`?
I did that originally, but `__clamp_to_integral` seemed like a general algorithm that didn't belong to `__random`, so I changed it. I'll change it back to `__random/` on the basis of "it's only used in `__random`" -- we can change that later if desired.


================
Comment at: libcxx/test/libcxx/numerics/clamp_to_integral.pass.cpp:18
+#include <limits>
+#include <numeric>
 
----------------
Quuxplusone wrote:
> This testing change implies that you meant to `#include <__numeric/clamp_to_integral.h>` from `<numeric>` (which would also be consistent with existing practice)... but you didn't.
> If you move it to `__random/`, then this here should `#include <random>` instead of `<numeric>`.
Yes, I forgot to do that indeed. Fixing, thanks.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D115282/new/

https://reviews.llvm.org/D115282



More information about the libcxx-commits mailing list