On Sun, Jan 25, 2026 at 6:44 AM Andrzej Krzemienski <akrzemi1@gmail.com> wrote:
niedz., 25 sty 2026 o 10:07 Alfredo Correa <alfredo.correa@gmail.com> napisał(a):
On Sat, Jan 24, 2026 at 7:38 AM Andrzej Krzemienski <akrzemi1@gmail.com> wrote:
10. Header `restriction.hpp` has functions `make_restriction()` defined. Are they intended for users? If so, they need to be listed in "Reference"' also.
I remember now by looking at the code. This `make_restriction` is in a detail namespace; it converts a rectangular initializer list into a lazy function for internal use, which is the only clean way to initialize from an initializer list without *intermediate* allocations.
Sorry for the confusion, the function is in the detail namespace and therefore still an implementation detail, not for users.
Oh, indeed, it is in namespace detail. Sorry. This is my bad. On the other hand, it is the last declaration in the header. No implementation uses it other than in unit tests. These declarations do not belong in the user-facing header.
Yes, I haven’t decided where to put these. I am in the process to actually moving the restrictions implementation to its own header. For the moment, trust the namespace location, not the physical location in the header.
The `multi::restriction` constructor (and CTAD) is enough to generate restrictions. There might be `multi::make_restriction` in the future, but mainly to cover cases where CTAD doesn't do the right thing, and one wants to "copy-by-reference-wrapper" with the helper `std::ref`. In the same way that CTAD `std::pair` doesn't 100% replace `std::make_pair`.
I did not express myself clearly. I unnecessarily used a name that is already taken in the library. I do not propose to use or overuse CTADs. I intended to propose a named factory function. I have now filed an issue for this that explains this better. https://github.com/correaa/boost-multi/issues/123
I like it. Would it be ok if the factory has the arguments reversed with respect to the constructor? I think so. I wouldn’t even mind if the restriction constructor(s) were private. <https://github.com/correaa/boost-multi/issues/123>
Regards, &rzej;
Thanks, Alfredo